From e2d0028c1fbfb4cac59e20926e5aa0031e0ed607 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 14 May 2022 22:40:28 +0900 Subject: add changelog field to frontmatter --- .../2021-10-02/python-unbound-local-error/index.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'docs/posts/2021-10-02/python-unbound-local-error/index.html') diff --git a/docs/posts/2021-10-02/python-unbound-local-error/index.html b/docs/posts/2021-10-02/python-unbound-local-error/index.html index 29901d5..1d93c29 100644 --- a/docs/posts/2021-10-02/python-unbound-local-error/index.html +++ b/docs/posts/2021-10-02/python-unbound-local-error/index.html @@ -31,13 +31,22 @@

[Python] クロージャとUnboundLocalError: local variable 'x' referenced before assignment

- +
-

この記事は Qiita から移植してきたものです。 +

+
+

更新履歴

+
    +
  • 2021-10-02: Qiita から移植
  • +
+
+

この記事は Qiita から移植してきたものです。 元 URL: https://qiita.com/nsfisis/items/5d733703afcb35bbf399


本記事は Python 3.7.6 の動作結果を元にして書かれている。

@@ -74,7 +83,8 @@ f() x += 1 g()

(*) のように、nonlocal を追加する。これにより一つ外側のスコープ (g の一つ外側 = f) で定義されている x を探しに行くようになる。

-
+ +