LazyImportsIterator

class LazyImportsIterator[T: Element]

An internally iterated generator for Element attributes that may include imported members.

for member in package.members.with_import_filter(...).collect():
    ...

Evaluation of import filters requires an explicit evaluator function because the model is treated as a data structure. It has no knowledge of expression evaluation semantics. In addition, this allows reusing virtual machines between different methods for improved performance.

%3 LazyImportsIterator LazyImportsIterator syside.LazyImportsIterator LazyIterator LazyIterator syside.LazyIterator LazyIterator->LazyImportsIterator
Members defined in LazyImportsIterator (1 member)

with_import_filter

Use the provided function to evaluate import filters.

Members inherited from LazyIterator (7 members)

__bool__

Returns True if this range is not empty.

__getitem__

Get value at index, This is computed lazily. Throws IndexError on out of bounds.

at

Get value at index. This is computed lazily. Returns None for out of bounds index.

collect

Collect all items into a list.

count

Count the number of items in this range. This is computed lazily.

empty

Check if this range is empty.

for_each

Lazily visit each item in this range. Visitation is stopped on returning False or VisitAction.Stop;

Methods

with_import_filter(arg: syside.CompilerFilter | Callable[[syside.Element, list[syside.Expression]], bool], /) syside.LazyImportsIterator[syside.T]

Use the provided function to evaluate import filters.

Note that this creates a copy of self with the new filter function.

Used in