<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>atsuhiro-me</author_name>
  <author_url>https://blog.hatena.ne.jp/atsuhiro-me/</author_url>
  <blog_title>みーのぺーじ</blog_title>
  <blog_url>https://pc.atsuhiro-me.net/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>例えば dict[int, int] を JSON で記述しようとすると，キーは文字列にする必要がありますが，Pydantic がうまく型変換してくれるので気にせず使えて便利です． % python --version Python 3.11.6 % pip freeze pydantic==2.5.2 test_pydantic.py import json import unittest from pydantic import BaseModel class A(BaseModel): str_dict: dict[str, int] int_dict: dict[int, int] c…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpc.atsuhiro-me.net%2Fentry%2F2023%2F12%2F17%2F003541&quot; title=&quot;Pydantic で JSON を読み込む時に型変換される - みーのぺーじ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-12-17 00:35:41</published>
  <title>Pydantic で JSON を読み込む時に型変換される</title>
  <type>rich</type>
  <url>https://pc.atsuhiro-me.net/entry/2023/12/17/003541</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
