From de13d68cddef5bb321469bcffb868f27ddd5390e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 12 Mar 2023 15:12:10 +0900 Subject: style: add .highlight class to pre tag --- public/posts/2021-10-02/python-unbound-local-error/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'public/posts/2021-10-02/python-unbound-local-error') diff --git a/public/posts/2021-10-02/python-unbound-local-error/index.html b/public/posts/2021-10-02/python-unbound-local-error/index.html index fa0b1db..27c2d05 100644 --- a/public/posts/2021-10-02/python-unbound-local-error/index.html +++ b/public/posts/2021-10-02/python-unbound-local-error/index.html @@ -60,7 +60,7 @@ Python でクロージャを作ろうと、次のようなコードを書いた。

-
+          
             def f():
 x = 0
 def g():
@@ -84,7 +84,7 @@ f()
             local変数xが代入前に参照された、とある。これは、fxを参照するのではなく、新しく別の変数をg内に作ってしまっているため。 前述のコードを宣言と代入を便宜上分けて書き直すと次のようになる。varを変数宣言のための構文として擬似的に利用している。
           

-
+          
             # 注: var は正しい Python の文法ではない。上記参照のこと
 def f():
 var x           #  f の local変数 'x' を宣言
@@ -101,7 +101,7 @@ g()
             当初の意図を表現するには、次のように書けばよい。
           

-
+          
             def f():
 x = 0
 def g():
-- 
cgit v1.2.3-70-g09d2