class documentation

class ClassHierarchyFinalizer: (source)

Constructor: ClassHierarchyFinalizer(classes)

View In Hierarchy

Encapsulate code related to class hierarchies post-processing.

Method __init__ No summary
Method compute_mros Undocumented
Instance Variable computed_mros Undocumented
Instance Variable graph Undocumented
Class Method _init_finalbaseobjects The base objects are computed in two passes, first the ast visitor sets _initialbaseobjects, then we set _finalbaseobjects from this function which should be called during post-processing.
Static Method _getbases Like Class.baseobjects but fallback to the expanded name if the base is not resolved to a Class object.
Method _compute_mro Compute the method resolution order for this class. This assumes that the MRO of the bases of the class have already been computed and stored in self.computed_mros.
def __init__(self, classes: Iterable[Class]): (source)
Parameters
classes:Iterable[Class]All classes of the system.
def compute_mros(self): (source)

Undocumented

Undocumented

Undocumented

def _init_finalbaseobjects(cls, o: Class, path: list[Class] | None = None): (source)

The base objects are computed in two passes, first the ast visitor sets _initialbaseobjects, then we set _finalbaseobjects from this function which should be called during post-processing.

Like Class.baseobjects but fallback to the expanded name if the base is not resolved to a Class object.

def _compute_mro(self, cls: Class) -> list[ClassOrStr]: (source)

Compute the method resolution order for this class. This assumes that the MRO of the bases of the class have already been computed and stored in self.computed_mros.