<?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>python</anon>
  </categories>
  <description>不要なimportをlazyにしたい場合がある。例えばdictknife.loadではフォーマットとしてjson,yaml,tomlをサポートしているのだけれど。 jsonだけで十分の処理でyamlやtomlをimportを行いたくない。 ふつうのlazy import ふつうのlazy importとして関数の中でimportする方法がある。 foo.py def use_json(data): import json return json.dumps(data) 例えばこういうコード(foo.py)は import foo されたタイミングではjsonがimportされずに、use_js…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpod.hatenablog.com%2Fentry%2F2017%2F08%2F05%2F203459&quot; title=&quot;不要なimportをlazyにしたい(ついでにちょっとしたsetupも呼びたい) - 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>https://gist.githubusercontent.com/podhmo/aaf9edaa57e5d5b8a2c3b735e4b66288/raw/be47416b63bc36fe4033d69c9e898d6e41a4ad4d/withtoml.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-08-05 20:40:52</published>
  <title>不要なimportをlazyにしたい(ついでにちょっとしたsetupも呼びたい)</title>
  <type>rich</type>
  <url>https://pod.hatenablog.com/entry/2017/08/05/203459</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
