First page Back Continue Last page Overview Graphics

Classes, that does not work

Why does it not work for built-in classes?

>>> x = 42 >>> x.a = "not possible to do it" Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'int' object has no attribute 'a'

>>> >>> lst = [34, 999, 1001] >>> lst.a = "forget it" Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'list' object has no attribute 'a'

It would be a problem of space consumption for classes like „int“!