How to adapt the Singleton pattern? (Deprecation warning)

后端 未结 3 1118
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-07 11:18

Few years ago I found an implementation of the Singleton pattern in Python by Duncan Booth:

class Singleton(object):
    \"\"\"
    Singleton class by Duncan Boo         


        
3条回答
  •  不思量自难忘°
    2021-02-07 11:44

    I found this pattern described in a Python 3 pattern and idioms source. This should certainly help. I would love to know if it solves your problem, although it may violate the minimal impact condition in your question.

    Python 3: The Singleton

提交回复
热议问题