Overriding a global

Jean-Michel Pichavant jeanmichel at sequans.com
Tue Dec 13 04:54:51 EST 2011


Steven D'Aprano wrote:
> On Mon, 12 Dec 2011 12:13:33 +0100, Jean-Michel Pichavant wrote:
>
>   
>> Using the same name for 2 different objects is a bad idea in general.
>>     
>
> We have namespaces precisely so you don't need to care about making names 
> globally unique.
>
>
>   
I don't get your point, namespaced names are unique, by definition.

foo.aname <> bar.aname

The OP showed a code where there was a confusion between a global name 
and a local one. There's no namespace involved. Having a local name 
identical to a global one is a bad idea, def.

JM



More information about the Python-list mailing list