On Fri, 24 Sep 2004 14:04:52 -0400, Dan Sugalski wrote:

> ...
> (Though class names/namespaces seem to be separate)
> ...

I think Guido might have made things a bit harder to separate out than you
anticipate, unless I misread you. It appears that modules and classes are
also imported into the same namespace as everything else in python.

To expand (but to make the output more compact), my earlier program:

#!/usr/bin/env python
import os as a
print a         # <module 'os' from '/usr/lib/python2.3/os.pyc'>
class a:
    pass
print a         # __main__.a
def a():
    pass
print a         # <function a at 0x401e0b54>
a = 7
print a         # 7


Also, if you are in the interactive interpreter and use dir() to explore
around, you can see that it's all just thrown in together.

-- 
Jonathan

Reply via email to