Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Jack-Lee-Hiter/AlgorithmsByPython
/ __new__
Method
__new__
Target Offer/Singleton.py:41–44 ·
view source on GitHub ↗
(cls, *args, **kwargs)
Source
from the content-addressed store, hash-verified
39
class
Borg(object):
40
_state = {}
41
def
__new__(cls, *args, **kwargs):
42
ob = super(Borg, cls).__new__(cls, *args, **kwargs)
43
ob.__dict__ = cls._state
44
return
ob
45
class
MyClass2(Borg):
46
a = 1
47
one = MyClass2()
Callers
1
__new__
Method · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected