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)
剑指offer python版 实现单例模式
猜你喜欢
转载自www.cnblogs.com/xzm123/p/9847787.html
今日推荐
周排行