class singleTon(object): def __init__(self,x): self.val=x single2=singleTon(2) a=single2 b=single2 print(a==b) print(a.val) a.val=334 print(b.val)
原文地址:https://www.cnblogs.com/xzm123/p/9847787.html
时间: 2024-11-05 22:50:38
class singleTon(object): def __init__(self,x): self.val=x single2=singleTon(2) a=single2 b=single2 print(a==b) print(a.val) a.val=334 print(b.val)
原文地址:https://www.cnblogs.com/xzm123/p/9847787.html