✏️ 编辑:patterns.py
路径:
/usr/lib/python3.9/site-packages/tuned/patterns.py
大小:335 B · 修改:2026-02-22 19:49:21 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
class Singleton(object): """ Singleton design pattern. """ _instance = None def __init__(self): if self.__class__ is Singleton: raise TypeError("Cannot instantiate directly.") @classmethod def get_instance(cls): """Get the class instance.""" if cls._instance is None: cls._instance = cls() return cls._instance
💾 保存
取消
保存为 UTF-8,换行统一为 LF