{"published":"2018-11-08 01:26:36","author_url":"https://blog.hatena.ne.jp/tmg1998/","height":"190","description":"\u30cd\u30b9\u30c8\u3057\u305f\u95a2\u6570\u3067\u3001\u4e0a\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u5909\u6570\u3092\u4f7f\u3046\u306b\u306fnonlocal\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u3046 def main(): a = 1 def child(): nonlocal a a += 1 print(a) print(a) child() print(a) main() \u51fa\u529b\u7d50\u679c 1 2 2 \u30cd\u30b9\u30c8\u3057\u305f\u95a2\u6570\u304b\u3089\u3001\u30a2\u30af\u30bb\u30b9\u3067\u304d\u305f\uff01\uff01 \u3053\u308c\u306f\u3001\u30e1\u30e2\u5316\u306e\u305f\u3081\u306e\u5b9f\u88c5\u65b9\u6cd5\u3089\u3057\u3044\u3002\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u3044\u3046\u3084\u3064 \u30e1\u30e2\u5316\u3063\u3066\u3069\u3063\u304b\u3067\u805e\u3044\u305f\u3053\u3068\u3042\u308b\u3002 \u305f\u3057\u304b\u3001\u540c\u3058\u5f15\u6570\u3060\u3063\u305f\u3089\u3001\u524d\u56de\u306e\u7d50\u679c\u3092\u305d\u306e\u307e\u307e\u8fd4\u3059\u3084\u3064\u3060\u3063\u3051 \u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u306f\u3053\u3093\u3069\u3061\u3083\u3093\u3068\u3084\u308b\u3002\u3053\u3093\u3069\u3002\u3046\u3093\u3002 \u53c2\u8003\u6587\u732e Python\u8d85\u5165\u9580\u305d\u306e\uff11\uff14\u301c\u610f\u5916\u3068\u91cd\u8981\u306a\u30b9\u30b3\u30fc\u30d7\u3092\u7406\u2026","version":"1.0","image_url":null,"width":"100%","blog_url":"https://tmg0525.hatenadiary.jp/","url":"https://tmg0525.hatenadiary.jp/entry/2018/11/08/012636","author_name":"tmg1998","type":"rich","categories":["python"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftmg0525.hatenadiary.jp%2Fentry%2F2018%2F11%2F08%2F012636\" title=\"nonlocal \u30cd\u30b9\u30c8\u3057\u305f\u95a2\u6570\u304b\u3089\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b - Python - TIL\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","title":"nonlocal \u30cd\u30b9\u30c8\u3057\u305f\u95a2\u6570\u304b\u3089\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b - Python","provider_url":"https://hatena.blog","blog_title":"TIL"}