[Python-Dev] peps 329, 266, 267
Jewett, Jim J
jim.jewett at eds.com
Thu Apr 22 14:42:59 EDT 2004
>> note that import * _already_ imports names which
>> shadow builtins, so the only real change would be
>> when the imported module does *not* shadow a
>> builtin, but your own module does (and does so
>> before the import, perhaps because of an earlier
>> import *).
Phillip J. Eby:
> I think you're missing the part where builtins
> change from one release to the next. I might have
> had a global named 'zip' or 'enumerate' in a Python
> 1.5 program, and when I upgrade to 2.4 I am now
> "shadowing a builtin".
How did you get that global? You either defined it
or imported it (or had it added by another module).
Any of these actions will still work, and will still
replace the cached builtin.
The only problem is if you then do an import * _after_
that definition. Doing that was already risking a break;
this change just makes the break a bit more likely.
More information about the Python-Dev