I have below code:
arg = object()
arg.abc = "abc_text"
print arg.abc
It throws error "AttributeError: 'object' object has no attribute 'abc'"
But When the code is modified to below, it works:
class MyCustomClass(object):
pass
arg = MyCustomClass()
arg.abc = "abc_text"
print arg.abc
What happened exactly I didn't understand at all. object is base for and class and I tried to set attribute. It should have worked. But it didn't. And what exactly happened when a custom class is called?