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

Method __new__

Lib/test/test_descr.py:497–499  ·  view source on GitHub ↗
(cls, name, bases, dict)

Source from the content-addressed store, hash-verified

495 self.assertEqual(d.__class__, D)
496 class M1(type):
497 def __new__(cls, name, bases, dict):
498 dict['__spam__'] = 1
499 return type.__new__(cls, name, bases, dict)
500 class C(metaclass=M1):
501 pass
502 self.assertEqual(C.__spam__, 1)

Callers

nothing calls this directly

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected