python实现单例模式
单例模式
说白了确保一个类不管实例化了多少次,都只有一个实例存在。
在python中,可以用类中的魔术方法__new___来实现单例模式。
class Myclass:
_fla ...
The journey is not over yet