TypeIndex

class TypeIndex

Description

Elements by exact Python class, built once by build_type_index().

Given a model that declares part def Vehicle; and part def Car :> Vehicle; in package P:

index = build_type_index(model)
index.by_exact_type[syside.PartDefinition]  # [P::Vehicle, P::Car]

by_exact_type maps each class that occurs in the indexed documents to the elements of exactly that class, in scan order. A lookup for X.STD reads the bucket of every class that matches, so one index serves every element_type.

Inheritance:

Members defined in TypeIndex (3 members)

by_exact_type

RW

library_elements

RW

The deprecated library_elements the index was built with, else None.

tiers

RW

The tiers the index was built over; None when it was built over the model’s own documents (the default build, a deprecated library_elements build, or a hand-built index).

Attributes

by_exact_type: dict[type[syside.Element], list[syside.Element]] = None
library_elements: syside.query.LibraryElements | None = None

The deprecated library_elements the index was built with, else None.

tiers: frozenset[syside.DocumentTier] | None = None

The tiers the index was built over; None when it was built over the model’s own documents (the default build, a deprecated library_elements build, or a hand-built index).

Used by