range¶
- guppylang.std.iter.range(start: int, stop: int = 0, step: int = 1) Range[source]¶
An iterator that yields a sequence of integers.
Behaves like the builtin Python range function. Concretely, the
i``th yielded number is ``start + i * step. Numbers are yielded as long as they are< stopin the case wherestep >= 0, or> stopotherwise.
startdefaults to0andstepdefaults to1. If the providedstopvalue is comptime known, then the returned iterator will have a static size annotation and may for example be used inside array comprehensions.