Python 2.4.2 (#1, Oct 13 2006, 17:11:24)
[GCC 4.1.0 (SUSE Linux)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
<object object at 0xb7bbd438>
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'object' object has no attribute 'spam'
.... pass
....
<__main__.b object at 0xb7b4dcac>
What is subclassing adding to the class here? Why can't I assign to
attributes of an instance of object?
--
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk
[GCC 4.1.0 (SUSE Linux)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>a = object()
>>a
>>a
>>a.spam = 1
File "<stdin>", line 1, in ?
AttributeError: 'object' object has no attribute 'spam'
>>class b(object):
....
>>a = b()
>>a
>>a
>>a.spam = 1
>>>
>>>
attributes of an instance of object?
--
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk
Comment