{"version":"1.0","image_url":null,"description":"\u30c4\u30a4\u30c3\u30bf\u30fc\u3067Python\u306e\u6587\u6cd5\u306e\u8a71\u984c\u304c\u76db\u3093\uff08\u4e09\u89d2\u95a2\u6570\u3068\u540c\u3058\u3067\u5468\u671f\u7684\u306b\u8a71\u984c\u306b\u306a\u308b\uff09\u3067\u3001\u500b\u4eba\u7684\u306b\u306f\u3042\u307e\u308a\u540c\u610f\u3067\u304d\u306a\u3044\u610f\u898b\u3082\u591a\u3044\u306e\u3060\u304c\u306a\u304b\u306a\u304b\u9762\u767d\u3044\u30c8\u30d4\u30c3\u30af\u3082\u3042\u308b\u3002 \u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\uff1a fs = [] for i in range(5): fs.append(lambda: i) for f in fs: print(f()) \u3053\u308c\u304c\u591a\u304f\u306e\u4eba\u306e\u76f4\u89b3\u306b\u53cd\u3057\u30664\u30925\u56de\u51fa\u529b\u3059\u308b\u3068\u3044\u3046\u6319\u52d5\u306b\u306a\u308b\u3002 \u3053\u306e\u3088\u3046\u306a\u6319\u52d5\u306b\u306a\u308b\u7406\u7531\u306f\u8907\u5408\u7684\u3067\uff1a \u5909\u6570i\u306e\u30b9\u30b3\u30fc\u30d7\u304cfor\u5185\u306e\u30d6\u30ed\u30c3\u30af\u3067\u5207\u308c\u3066\u3044\u306a\u3044 lambda: i\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u95a2\u6570\u304c\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u3057\u3066lexical scope\u3067\u5909\u66f4\u3055\u308c\u7d9a\u3051\u308b\u5909\u6570i\u3092\u6355\u6349\u3057\u3066\u3044\u308b\u2026","url":"https://zehnpaard.hatenablog.com/entry/2022/05/27/080010","author_url":"https://blog.hatena.ne.jp/zehnpaard/","published":"2022-05-27 08:00:10","title":"Python\u3067\u5909\u6570\u30b9\u30b3\u30fc\u30d7\u304c\u30d6\u30ed\u30c3\u30af\u30d9\u30fc\u30b9\u3060\u3068\u5927\u5909\u305d\u3046","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2022%2F05%2F27%2F080010\" title=\"Python\u3067\u5909\u6570\u30b9\u30b3\u30fc\u30d7\u304c\u30d6\u30ed\u30c3\u30af\u30d9\u30fc\u30b9\u3060\u3068\u5927\u5909\u305d\u3046 - Arantium Maestum\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["Python"],"blog_title":"Arantium Maestum","blog_url":"https://zehnpaard.hatenablog.com/","height":"190","width":"100%","provider_url":"https://hatena.blog","author_name":"zehnpaard","type":"rich"}