I am trying to achieve the following case:
class ABCD(object):
def __str__(self):
return "some string"
a=ABCD()
print a
some string
Using type:
A=type("A",(object,),dict(__str__="some string",h=5))
a=A()
print a
But get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable