Is it just an implementation limitation that attributes cannot be
assigned to instances of internal types?
---
>>> x = 4
>>> type(x)
>>> class Test(int):
... pass
...
>>> y = Test(4)
>>> type(y)
>>> y.someattr = 10
>>> x.someattr = 10
Traceback (most recent call last)
You might find this usefull specifically the stuff on subclassing
built-in types.
http://www.python.org/2.2/descrintro.html
--
http://mail.python.org/mailman/listinfo/python-list
Dave Opstad wrote:
Is it just an implementation limitation that attributes cannot be
assigned to instances of internal types?
No, not "just". Some types have a fixed set of attributes by design,
whereas others allow addition of attributes. There are several reasons
for this design. Performance is