baml.iter.StepBy$stream

The iterator `baml.iter.Iterator.step_by` returns.

Reference version

Signature

class baml.iter.StepBy$stream<T, E>

The iterator baml.iter.Iterator.step_by returns.

The first next simply forwards to the source; every later one discards n - 1 elements before forwarding, which is what makes the yielded positions 0, n, 2n, … The discarded elements are still pulled, so they can still throw.

Source:<builtin>/baml/ns_iter/iter.bamlbytes 0–0

Fields

n

int | null

The stride: how far to advance between yielded elements.

first

bool | null

Whether the next pull is the first one, which is yielded without skipping ahead.

Implementations

baml.Concrete for T

Source:<builtin>/baml/core.bamlbytes 747–779