instantiations1 Python 싱글톤을 정의하는 간단하고 우아한 방법이 있을까요? [중복됨], Is there a simple, elegant way to define singletons? [duplicate] 질문 파이썬에서 싱글톤을 정의하는 다양한 방법이 있는 것 같습니다. Stack Overflow에서는 합의된 의견이 있을까요? 답변 I don't really see the need, as a module with functions (and not a class) would serve well as a singleton. All its variables would be bound to the module, which could not be instantiated repeatedly anyway. If you do wish to use a class, there is no way of creating private classes or private constructors in Python, so you ca.. 2023. 10. 12. 이전 1 다음