Nested scopes: why is it weird?

Cliff Wells logiplexsoftware at earthlink.net
Fri Sep 7 18:18:41 EDT 2001


On Friday 07 September 2001 14:13, Brian Quinlan wrote:
>
> I'm pretty sure that Paul was arguing that you should not be able to
> shadow variables used in enclosing lexical scopes i.e. it would be an
> error to rebind a name used in an enclosing lexical scope.
>

I don't know, I learned on Pascal way back when and it did the same thing 
(basically), although it did allow you to alter the value of the variable 
from the enclosing scope, so this approach makes sense to me (in fact, when I 
moved to C, I missed nested function scoping as it can provide a nice 
organizational method).  I suppose this is simply one of those issues that is 
mostly a matter of preference, so I simply disagree.

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