> >>>>> "GvR" == Guido van Rossum <guido@digicool.com> writes: > > >> I'm a little concerned about this, since the names that would > >> be added are probably in common use as variable and/or argument > >> names. I.e. At one point `list' was a very common identifier > >> in Mailman, and I'm sure `dict' is used quite often still. I > >> guess this would be okay as long as working code doesn't break > >> because of it. > > GvR> It would be hard to see how this would break code, since > GvR> built-ins are searched *after* all variables that the user > GvR> defines. > > Wasn't there talk about issuing warnings for locals shadowing > built-ins (or was that globals?). If not, fergitaboutit. If so, that > would fall under the category of "breaking". > > -Barry You may be thinking of this: >>> def f(int): def g(): int <stdin>:1: SyntaxWarning: local name 'int' in 'f' shadows use of 'int' as global in nested scope 'g' >>> This warns you when you override a built-in or global *and* you use that same name in a nested function. This code will mean something different in 2.2 anyway (g's reference to int will become a reference to f's int because of nested scopes). But this does not cause a warning: >>> def g(): int = 12 >>> Nor does this: >>> int = 12 >>> So we're safe. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4