<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>podhmo</author_name>
  <author_url>https://blog.hatena.ne.jp/podhmo/</author_url>
  <blog_title>podhmo's diary</blog_title>
  <blog_url>https://pod.hatenablog.com/</blog_url>
  <categories>
    <anon>mypy</anon>
    <anon>python</anon>
    <anon>typing</anon>
  </categories>
  <description>Type hints pythonでも型を書きたいですよね。type hintsがあります。 これが def hello(name): return f&quot;hello {name}!&quot; こう。 def hello(name: str) -&gt; str: return f&quot;hello {name}!&quot; 型が指定できます。 Literal types ところで型の指定は文字列型だけで十分ですか？特定の文字列だけに値の範囲を制限したくないですか？ Lietral typesがあります。 例えばこういう関数が &quot;hello&quot; と &quot;bye&quot; だけを許したい場合には、 def greet(name: str…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpod.hatenablog.com%2Fentry%2F2019%2F10%2F29%2F221912&quot; title=&quot;mypyのLiteral typesのお供には--strict-equalityオプションを - podhmo&amp;#39;s diary&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>2019-10-29 22:19:12</published>
  <title>mypyのLiteral typesのお供には--strict-equalityオプションを</title>
  <type>rich</type>
  <url>https://pod.hatenablog.com/entry/2019/10/29/221912</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
