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< stop
in the case wherestep >= 0
, or> stop
otherwise.
start
defaults to0
andstep
defaults to1
. If the providedstop
value is comptime known, then the returned iterator will have a static size annotation and may for example be used inside array comprehensions.