为什么下面的代码给出了错误?
class Foo:
def __new__(cls, *args, **kwargs):
print("Creating Instance")
instance = super(Foo, cls).__new__(cls,*args, **kwargs)
return instance
def __init__(self, a, b):
self.a = a
self.b = b
z= Foo(2,3)
下面给出的错误是
TypeError: object.__new__() takes exactly one argument (the type to instantiate)