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 where step >= 0, or

  • > stop otherwise.

start defaults to 0 and step defaults to 1. If the provided stop value is comptime known, then the returned iterator will have a static size annotation and may for example be used inside array comprehensions.