[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 801- 901- 2chのread.cgiへ]
Update time : 02/24 01:18 / Filesize : 206 KB / Number-of Response : 962
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

Pythonのお勉強 Part30



436 名前:デフォルトの名無しさん mailto:sage [2008/12/06(土) 00:09:04 ]
>>433
docs.python.org/reference/executionmodel.html#naming-and-binding

If a name binding operation occurs anywhere within a code block,
all uses of the name within the block are treated as references to
the current block.
This can lead to errors when a name is used within a block before it is bound.
This rule is subtle. Python lacks declarations and
allows name binding operations to occur anywhere within a code block.
The local variables of a code block can be determined
by scanning the entire text of the block for name binding operations.

と書いてあるので、仕様だろう
結局のところletのような構文は無いのだし、それがPythonなのだと思うしかない

俺は最近はletだのvarだのmyだのが無いことの不便さのほうを感じることが
多いな







[ 続きを読む ] / [ 携帯版 ]

全部読む 前100 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<206KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef