{"provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/terurou/","width":"100%","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fterurou.hateblo.jp%2Fentry%2F20100617%2F1276702834\" title=\"Python\u3067\u30cd\u30b9\u30c8\u3057\u305f\u95a2\u6570\u3068\u30b9\u30b3\u30fc\u30d7 - terurou\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","description":"\u4ed6\u306e\u8a00\u8a9e\u3070\u3063\u304b\u89e6\u3063\u3066\u308b\u3068\u3059\u3050\u306b\u5fd8\u308c\u3066\u308b\u306e\u3067\u30e1\u30e2\u3002\u65e5\u672c\u91523\u5408\u3050\u3089\u3044\u98f2\u307f\u306a\u304c\u3089\u66f8\u3044\u3066\u308b\u306e\u3067\u5909\u306a\u3053\u3068\u66f8\u3044\u3066\u308b\u304b\u3082\u3002Python\u3067\u306f\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068UnboundLocalException\uff08\u5909\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u306d\u30fc\u305e\u4f8b\u5916\uff09\u304c\u51fa\u308b\u3002 def foo(): x = 0 def bar(): x += 1 # \u3053\u3053\u3067\u30a8\u30e9\u30fc bar() foo() \u3061\u306a\u307f\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3060\u3068\u5927\u4e08\u592b\u3002 def foo(): x = 0 def bar(): print x bar() foo() \u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306b\u5bfe\u3057\u3066\u306e\u4ee3\u5165\uff08bind\uff09\u306fOK\u3060\u3051\u3069\u3001\u30b9\u30b3\u30fc\u30d7\u306e\u5916\u5074\u306e\u5909\u6570\u306freadonly\u3067\u3059\u3088\uff08\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3044\u2026","published":"2010-06-17 00:40:34","blog_title":"terurou\u30e1\u30e2","categories":["python"],"version":"1.0","provider_name":"Hatena Blog","title":"Python\u3067\u30cd\u30b9\u30c8\u3057\u305f\u95a2\u6570\u3068\u30b9\u30b3\u30fc\u30d7","url":"https://terurou.hateblo.jp/entry/20100617/1276702834","author_name":"terurou","blog_url":"https://terurou.hateblo.jp/","height":"190"}