range

Module

Implements a ‘range’ call.

These are Mojo built-ins, so you don’t need to import them.

range

range(end: Int) -> _ZeroStartingRange

Constructs a [0; end) Range.

Args:

  • end (Int): The end of the range.

Returns:

The constructed range.

range(end: PythonObject) -> _ZeroStartingRange

Constructs a [0; end) Range.

Args:

  • end (PythonObject): The end of the range.

Returns:

The constructed range.

range(length: object) -> _ZeroStartingRange

Constructs a [0; length) Range.

Args:

  • length (object): The end of the range.

Returns:

The constructed range.

range(start: Int, end: Int) -> _SequentialRange

Constructs a [start; end) Range.

Args:

  • start (Int): The start of the range.
  • end (Int): The end of the range.

Returns:

The constructed range.

range(start: object, end: object) -> _SequentialRange

Constructs a [start; end) Range.

Args:

  • start (object): The start of the range.
  • end (object): The end of the range.

Returns:

The constructed range.

range(start: PythonObject, end: PythonObject) -> _SequentialRange

Constructs a [start; end) Range.

Args:

  • start (PythonObject): The start of the range.
  • end (PythonObject): The end of the range.

Returns:

The constructed range.

range(start: Int, end: Int, step: Int) -> _StridedRange

Constructs a [start; end) Range with a given step.

Args:

  • start (Int): The start of the range.
  • end (Int): The end of the range.
  • step (Int): The step for the range.

Returns:

The constructed range.

range(start: object, end: object, step: object) -> _StridedRange

Constructs a [start; end) Range with a given step.

Args:

  • start (object): The start of the range.
  • end (object): The end of the range.
  • step (object): The step for the range.

Returns:

The constructed range.

range(start: PythonObject, end: PythonObject, step: PythonObject) -> _StridedRange

Constructs a [start; end) Range with a given step.

Args:

  • start (PythonObject): The start of the range.
  • end (PythonObject): The end of the range.
  • step (PythonObject): The step for the range.

Returns:

The constructed range.