On Tue, Jun 11, 2013 at 1:02 PM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > Apart from Erlang, got any other examples? Because it seems to me that in > languages with nested scopes or namespaces, shadowing higher levels is > exactly the right thing to do. Certainly it would be a PITA, and defeat > the purpose of having nested scopes, if inner names had to be globally > unique.
I agree, and it's one of the reasons that I like the explicitness of C's variable declarations. Sure, Python makes it easier to write code; but it's easier to figure out what's a global and what's not when locals are all declared. (Yes, it's not that hard for a human to recognize when a name is being rebound as opposed to merely used, but it's extra work for a lexer/syntax highlighter.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list