plain object()

Lee Harr missive at frontiernet.net
Wed Apr 30 21:03:25 EDT 2003


Hi;

Can someone explain this?


>>> a = object()
>>> a
<object object at 0x8149bc0>
>>> a.x = 3
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'object' object has no attribute 'x'
>>> class B(object):
...   pass
...
>>> b = B()
>>> b
<__main__.B object at 0x81194cc>
>>> b.x = 3
>>> b.x
3
>>>






More information about the Python-list mailing list