<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ShineSpark</author_name>
  <author_url>https://blog.hatena.ne.jp/ShineSpark/</author_url>
  <blog_title>人生シーケンスブレイク</blog_title>
  <blog_url>https://shinespark.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>先日ハマったのでメモ。 結論 Pythonの引数のデフォルト値は一度しか評価されない。 def func(url, l=[]): … としたい場合には、代わりに def func(url, l=None): if l is None: l = [] … とする。 背景 GitHub APIを叩いて全てのbranch_listを取得しようと、 以下のような関数を書いた。 def fetch_all(url, all_list=[]): res = urllib.request.urlopen(url) res_link, res_body = res.getheader('Link'), res…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshinespark.hatenablog.com%2Fentry%2F2015%2F11%2F03%2F124239&quot; title=&quot;Pythonの引数のデフォルト値は一度しか評価されない - 人生シーケンスブレイク&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>http://ecx.images-amazon.com/images/I/51fpQ3aaI8L.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-11-03 12:42:39</published>
  <title>Pythonの引数のデフォルト値は一度しか評価されない</title>
  <type>rich</type>
  <url>https://shinespark.hatenablog.com/entry/2015/11/03/124239</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
