<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>terurou</author_name>
  <author_url>https://blog.hatena.ne.jp/terurou/</author_url>
  <blog_title>terurouメモ</blog_title>
  <blog_url>https://terurou.hateblo.jp/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>他の言語ばっか触ってるとすぐに忘れてるのでメモ。日本酒3合ぐらい飲みながら書いてるので変なこと書いてるかも。Pythonでは以下のコードを実行するとUnboundLocalException（変数が定義されてねーぞ例外）が出る。 def foo(): x = 0 def bar(): x += 1 # ここでエラー bar() foo() ちなみに以下のコードだと大丈夫。 def foo(): x = 0 def bar(): print x bar() foo() ローカル変数に対しての代入（bind）はOKだけど、スコープの外側の変数はreadonlyですよ（ローカル変数が定義されていない…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fterurou.hateblo.jp%2Fentry%2F20100617%2F1276702834&quot; title=&quot;Pythonでネストした関数とスコープ - terurouメモ&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>2010-06-17 00:40:34</published>
  <title>Pythonでネストした関数とスコープ</title>
  <type>rich</type>
  <url>https://terurou.hateblo.jp/entry/20100617/1276702834</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
