MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / Borg

Class Borg

contents/design-pattern/code/SingletonPython/borg_singleton.py:3–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1__author__ = 'Chetan'
2
3class Borg:
4 __shared_state = {}
5 def __init__(self):
6 self.x = 1
7 self.__dict__ = self.__shared_state
8 pass
9
10b = Borg()
11b1 = Borg()

Callers 1

borg_singleton.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected