Nested scopes: why is it weird?

Cliff Wells logiplexsoftware at earthlink.net
Fri Sep 7 17:29:54 EDT 2001


On Friday 07 September 2001 14:20, Paul Prescod wrote:

> Side effects are a fundamental part of Python programming. If they
> weren't, Python wouldn't have the "global" keyword. 

Just because something is available doesn't make it fundamental.

> I think it is great
> that Python requires you to be explicit when you want to overwrite a
> global variable. 

I agree.

> I think it should similarly reqiure you to be explicit
> when you want to shadow one. Or it could simply disallow the shadowing
> -- it isn't very useful anyhow. Just call the inner a "inner_a".

Actually, it is useful for things like lambda functions so you can avoid 
passing half a dozen arguments.

Regards,

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308




More information about the Python-list mailing list