MCPcopy Index your code
hub / github.com/python/cpython / _instantiate

Method _instantiate

Lib/pickle.py:1629–1639  ·  view source on GitHub ↗
(self, klass, args)

Source from the content-addressed store, hash-verified

1627 # klass is the class to instantiate, and k points to the topmost mark
1628 # object, following which are the arguments for klass.__init__.
1629 def _instantiate(self, klass, args):
1630 if (args or not isinstance(klass, type) or
1631 hasattr(klass, "__getinitargs__")):
1632 try:
1633 value = klass(*args)
1634 except TypeError as err:
1635 raise TypeError("in constructor for %s: %s" %
1636 (klass.__name__, str(err)), err.__traceback__)
1637 else:
1638 value = klass.__new__(klass)
1639 self.append(value)
1640
1641 def load_inst(self):
1642 module = self.readline()[:-1].decode("ascii")

Callers 2

load_instMethod · 0.95
load_objMethod · 0.95

Calls 3

strFunction · 0.85
__new__Method · 0.45
appendMethod · 0.45

Tested by

no test coverage detected