TypeIndex

class TypeIndex

A concrete-type -> elements lookup, built once by build_type_index().

by_exact_type maps each concrete Python class object that actually occurs in the model to the list of elements of exactly that class, in scan order. find_elements_of_type with include_subtypes=True unions the buckets of every concrete subclass; with include_subtypes=False it reads a single bucket.

Keying on type(element) (the exact runtime class) keeps the index independent of any particular query’s subtype set, so one index serves every element_type argument.

Members defined in TypeIndex (1 member)

Attributes

by_exact_type: dict[type[syside.Element], list[syside.Element]] = None
Used in