MCPcopy 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

39class 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
45class MyClass2(Borg):
46 a = 1
47one = MyClass2()

Callers 1

__new__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected