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

Method _walk_mro

traitlets/config/configurable.py:528–540  ·  view source on GitHub ↗

Walk the cls.mro() for parent classes that are also singletons For use in instance()

(cls)

Source from the content-addressed store, hash-verified

526
527 @classmethod
528 def _walk_mro(cls) -> t.Generator[type[SingletonConfigurable], None, None]:
529 """Walk the cls.mro() for parent classes that are also singletons
530
531 For use in instance()
532 """
533
534 for subclass in cls.mro():
535 if (
536 issubclass(cls, subclass)
537 and issubclass(subclass, SingletonConfigurable)
538 and subclass != SingletonConfigurable
539 ):
540 yield subclass
541
542 @classmethod
543 def clear_instance(cls) -> None:

Callers 2

clear_instanceMethod · 0.80
instanceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected