더북(TheBook)
class Borg:
    _the_collective = {}

    def __init__(self):
        self.__dict__ = self._the_collective

    def _ _eq_ _(self, other):
        return isinstance(other, self.__class__)

보르그는 여러 개 존재할 수 있지만, 모든 속성과 메서드는 서로 공유합니다. 하지만 None은 여전히 제대로 된 싱글턴입니다.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.