[Python-3000] Sky pie: a "var" keyword

Brian Quinlan brian at sweetapp.com
Mon Oct 9 22:04:11 CEST 2006


Marcin 'Qrczak' Kowalczyk wrote:
> Fredrik Lundh <fredrik at pythonware.com> writes:
> 
>>> It also allows to put globals in an array instead of a dictionary,
>>> making them as fast as locals.
>> so module namespaces will no longer be populated by *executing* the 
>> module contents?
> 
> They would, but the set of global names except 'from module import *'
> (which would need a slower lookup mechanism) could be determined
> without executing it.

That would be a pretty big semantic change from Python <3000. e.g.

if sys.platform.startswith('win32'):
    import win32api
    def get_filesystem_roots():
        return win32api.GetLogicalDrives()
else:
    def get_filesystem_roots():
        return ['/']

How do I statically determine if win32api is a global or not? Do I have 
to declare it? Also, what happens in the presence of "exec" statements?

Cheers,
Brian



More information about the Python-3000 mailing list