会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
大师之路
千淘万漉虽辛苦,吹尽狂沙始到金。
博客园
首页
新随笔
联系
管理
订阅
2020年8月21日
__new__方法与单键实例
摘要: class T(object): def __init__(self,a): self.a=a def __new__(cls, *args, **kwargs): if not hasattr(cls, '_instance'): cls._instance = super().__new__(c
阅读全文
posted @ 2020-08-21 16:36 一花一世界,一叶一乾坤
阅读(119)
评论(0)
推荐(0)
编辑
公告