While reading this: What is a metaclass in Python?, I am learning to use __new__
using the following snippet:-
class a(object):
pass
a.__new__(int,'abcdef',(int,),{})
There could be some problem in calling __new__
using 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 there is something to do with the usage of __new__
, I can ammend that by reading some books. But, can someone please explain why this message comes:
object.__new__(int) is not safe, use int.__new__()