MCPcopy Create free account
hub / github.com/ipython/traitlets / __new__

Method __new__

traitlets/traitlets.py:1299–1308  ·  view source on GitHub ↗
(cls, /, *args: t.Any, **kwargs: t.Any)

Source from the content-addressed store, hash-verified

1297 """The base class for all classes that have descriptors."""
1298
1299 def __new__(cls, /, *args: t.Any, **kwargs: t.Any) -> Self:
1300 # This is needed because object.__new__ only accepts
1301 # the cls argument.
1302 new_meth = super(HasDescriptors, cls).__new__
1303 if new_meth is object.__new__:
1304 inst = new_meth(cls)
1305 else:
1306 inst = new_meth(cls, *args, **kwargs)
1307 inst.setup_instance(*args, **kwargs)
1308 return inst
1309
1310 def setup_instance(self, /, *args: t.Any, **kwargs: t.Any) -> None:
1311 """

Callers 1

__new__Method · 0.45

Calls 1

setup_instanceMethod · 0.45

Tested by

no test coverage detected