# pcj
class Musicplay(object):
id=None
def __new__(cls, *args, **kwargs):
if cls.id is None:
cls.id=super().__new__(cls) #new是一个静态方法。所以要传cls参数
return cls.id
def __init__(self):
print("音乐初始化中........")
music1=Musicplay()
music2=Musicplay()
print(music1)
print(music2)