reference vs. name space question

chad cdalten at gmail.com
Sat Oct 9 21:44:29 CEST 2010


Given the following...

[cdalten at localhost oakland]$ python
Python 2.6.2 (r262:71600, May  3 2009, 17:04:44)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class foo:
...   x = 1
...   y = 2
...
>>> one = foo()
>>> two = foo()
>>> print one
<__main__.foo instance at 0xb7f3a2ec>
>>> print two
<__main__.foo instance at 0xb7f3a16c>
>>> one.x
1


Is 'one' a reference or a name space?  Also, in 'one.x'. would 'one'
be the name space?

Chad



More information about the Python-list mailing list