Hi there!
I'd like to know why one is able to create a new attribute ("new" means "not previously defined in the class body") for an instance of a custom type, but is not able to do the same for a built-in type, like object
itself.
A code example:
>>> class SomeClass(object):
... pass
...
>>> sc = SomeClass()
>>> sc.name = "AAA"
>>> sc.name
'AAA'
>>> obj = object()
>>> obj.name = "BBB"
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'object' object has no attribute 'name'