python:singleton
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판 | ||
python:singleton [2021/03/12 15:51] – rex8312 | python:singleton [2024/03/23 02:42] (현재) – 바깥 편집 127.0.0.1 | ||
---|---|---|---|
줄 4: | 줄 4: | ||
# class Singleton(type): | # class Singleton(type): | ||
# | # | ||
- | # | ||
# def __call__(cls, | # def __call__(cls, | ||
# if cls not in cls._instances: | # if cls not in cls._instances: | ||
줄 12: | 줄 11: | ||
class Singleton(type): | class Singleton(type): | ||
| | ||
- | |||
def __call__(cls, | def __call__(cls, | ||
| | ||
줄 34: | 줄 32: | ||
print(MyClass().x) | print(MyClass().x) | ||
</ | </ | ||
- | | + | |
- | * http:// | + | * https:// |
+ | |
python/singleton.1615564287.txt.gz · 마지막으로 수정됨: (바깥 편집)