Overriding a global

Dave Angel d at davea.name
Mon Dec 12 20:46:14 EST 2011


On 12/12/2011 06:48 PM, Joshua Landau wrote:
>>> If a function knows of the presence of a global, it's not asking too
>>> much for it to not re-use the same name in local scope.
>> Yes.
>
> It's just a function wanting to act as-if it were in a different
> environment than its default. By that same reasoning you could state that
> "If a function knows of the presence of a built-in, it's not asking
> too much for it to not re-use the same name in local scope."
> <SNIP>
It's entirely different.  It's only the same if the function actually 
tries to call the built-in, then also wants a local variable with a 
different purpose.  Think a little about what I mean that the function 
"knows of the presence."  I did not say the programmer knows of the 
presence.
-- 

DaveA




More information about the Python-list mailing list