Pythonのお勉強 Part30
at TECH
436:デフォルトの名無しさん
08/12/06 00:09:04
>>433
URLリンク(docs.python.org)
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だのが無いことの不便さのほうを感じることが
多いな
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5092日前に更新/206 KB
担当:undef