Fork me on GitHub
摘要: 一、单例模式定义 单例模式是一种常用的创建型设计模式,它保证一个类只有一个实例,并提供一个全局的访问点。 二、实例展示 实例1: class Singleton: _instance = None def __new__(cls): if cls._instance is None: cls._in 阅读全文
posted @ 2023-04-16 23:44 橘子偏爱橙子 阅读(19) 评论(0) 推荐(0) 编辑