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

Method class_init

traitlets/traitlets.py:459–470  ·  view source on GitHub ↗

Part of the initialization which may depend on the underlying HasDescriptors class. It is typically overloaded for specific types. This method is called by :meth:`MetaHasDescriptors.__init__` passing the class (`cls`) and `name` under which the descriptor ha

(self, cls: type[HasTraits], name: str | None)

Source from the content-addressed store, hash-verified

457 this_class: type[HasTraits] | None = None
458
459 def class_init(self, cls: type[HasTraits], name: str | None) -> None:
460 """Part of the initialization which may depend on the underlying
461 HasDescriptors class.
462
463 It is typically overloaded for specific types.
464
465 This method is called by :meth:`MetaHasDescriptors.__init__`
466 passing the class (`cls`) and `name` under which the descriptor
467 has been assigned.
468 """
469 self.this_class = cls
470 self.name = name
471
472 def subclass_init(self, cls: type[HasTraits]) -> None:
473 # Instead of HasDescriptors.setup_instance calling

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected