So, I was playing around with Python while answering this question, and I discovered that this is not valid:
o = object() o.attr = \'hello\'
It's because object is a "type", not a class. In general, all classes that are defined in C extensions (like all the built in datatypes, and stuff like numpy arrays) do not allow addition of arbitrary attributes.