Pythonのお勉強 Part30 at TECH
[2ch|▼Menu]
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