class User:
def __new__(cls, *args, **kwargs):
print("in new ")
return super().__new__(cls)
def __init__(self,name):
print("in init ")
self.name = name
user = User("zhou")
print(user.name)
in new
in init
zhou
网友评论