When reading this: What is a metaclass in Python? I am studying using __new__ with the following snippet: -
class a(object): pass a.__new__(int,'abcdef',(int,),{})
There may be a problem when calling __new__ with a. . But, I get the following error, the meaning of which I do not understand: -
TypeError: object.__new__(int) is not safe, use int.__new__()
If something has to do with using __new__ , I can change that by reading some books. But can someone explain why this message is coming:
object.__new__(int) is not safe, use int.__new__()
source share