strange behavor....

Arnaud Delobelle arnodel at gmail.com
Sun Nov 14 03:15:27 EST 2010


Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:

> On Sat, 13 Nov 2010 23:14:22 +0000, Arnaud Delobelle <arnodel at gmail.com>
> declaimed the following in gmane.comp.python.general:
>
>
>>     Two occurences of the name "a" belong to the same namespace
>>
> 	Pardon? By definition, any given namespace can have only one
> occurence of any given name...

Well, yes, but I'm talking about occurences *in code*.  In the following
code:

    def foo():
        a = 1
        a = 2

the name "a" occurs twice, both occurences belong to the same namespace.

-- 
Arnaud



More information about the Python-list mailing list