[Python-Dev] problem with assignment shadows builtin warning

Guido van Rossum guido@python.org
Mon, 16 Jun 2003 16:23:03 -0400


> so code like
> 
> <pkg/__init__.py>
> 
> 
> def reveal():
>    print list
> 
> </pkg/__init__.py>
> 
> if pkg has a list subpackage/module will show that we are cheating, after 
> caching is implemented, wrt to the old global->builtins lookup rule, 
> because after:
> 
> import pkg.list
> 
> pkg.__dict__['list'] will be a module
> 
> but
> 
> pkg.reveal() will print the list builtin.

No, the parser should know about the subpackage...

--Guido van Rossum (home page: http://www.python.org/~guido/)