the demise of 'from foo import * and its implications?

Robin Becker robin at jessikat.fsnet.co.uk
Mon Mar 5 17:56:54 CET 2001


In article <mailman.983806269.21732.python-list at python.org>, Thomas
Wouters <thomas at xs4all.net> writes
>
....
>> 
>> doesn't from foo import * make things hard to locate at the global level
>> as well? exec/eval/import can always do this surely.
>
>The global namespace is a 'last call' namespace. The compiler doesn't (and
>can't, since you can modify global namespaces from outside the namespace)
>keep track of global names because it isn't necessary. Neither is true for
>function namespaces.
>
it isn't necessary in function namespaces either it's desirable to help
the compiler and apparently now required to enforce the constant scope
requirement. If the argument is that exec/eval/import can retarget names
then that argument applies to the global scope as well (and as you point
out) other things can modify globals as well. I would still like
regularity of expression to override efficiency as is currently the
case. 
-- 
Robin Becker



More information about the Python-list mailing list