Skip to main content

Mojo trait

ReversibleRange

The ReversibleRange trait describes a range that can be reversed.

Any type that conforms to ReversibleRange works with the builtin reversed() functions.

The ReversibleRange trait requires the type to define the __reversed__() method.

Note: iterators are currently non-raising.

Implemented traits

AnyType

Methods

__reversed__

__reversed__(self: T) -> _StridedRange

Get a reversed iterator for the type.

Note: iterators are currently non-raising.

Returns:

The reversed iterator of the type.