Mojo function
reversed
reversed[T: ReversibleRange](value: T) -> _StridedRange
Get a reversed iterator of the input range.
Note: iterators are currently non-raising.
Parameters:
- βT (
ReversibleRange
): The type conforming to ReversibleRange.
Args:
- βvalue (
T
): The range to get the reversed iterator of.
Returns:
The reversed iterator of the range.
reversed[T: CollectionElement](ref [value_is_lifetime] value: List[T, hint_trivial_type]) -> _ListIter[$2, $0, $1, $3, 0]
Get a reversed iterator of the input list.
Note: iterators are currently non-raising.
Parameters:
- βT (
CollectionElement
): The type of the elements in the list.
Args:
- βvalue (
List[T, hint_trivial_type]
): The list to get the reversed iterator of.
Returns:
The reversed iterator of the list.
reversed[K: KeyElement, V: CollectionElement](ref [value_is_lifetime] value: Dict[K, V]) -> _DictKeyIter[$2, $0, $1, $3, 0]
Get a reversed iterator of the input dict.
Note: iterators are currently non-raising.
Parameters:
- βK (
KeyElement
): The type of the keys in the dict. - βV (
CollectionElement
): The type of the values in the dict.
Args:
- βvalue (
Dict[K, V]
): The dict to get the reversed iterator of.
Returns:
The reversed iterator of the dict keys.
reversed[K: KeyElement, V: CollectionElement, dict_mutability: Bool, dict_lifetime: AnyLifetime[$2.value]](ref [value_is_lifetime] value: _DictValueIter[dict_mutability, K, V, dict_lifetime, 1]) -> _DictValueIter[$2, $0, $1, $3, 0]
Get a reversed iterator of the input dict values.
Note: iterators are currently non-raising.
Parameters:
- βK (
KeyElement
): The type of the keys in the dict. - βV (
CollectionElement
): The type of the values in the dict. - βdict_mutability (
Bool
): Whether the reference to the dict values is mutable. - βdict_lifetime (
AnyLifetime[$2.value]
): The lifetime of the dict values.
Args:
- βvalue (
_DictValueIter[dict_mutability, K, V, dict_lifetime, 1]
): The dict values to get the reversed iterator of.
Returns:
The reversed iterator of the dict values.
reversed[K: KeyElement, V: CollectionElement, dict_mutability: Bool, dict_lifetime: AnyLifetime[$2.value]](ref [value_is_lifetime] value: _DictEntryIter[dict_mutability, K, V, dict_lifetime, 1]) -> _DictEntryIter[$2, $0, $1, $3, 0]
Get a reversed iterator of the input dict items.
Note: iterators are currently non-raising.
Parameters:
- βK (
KeyElement
): The type of the keys in the dict. - βV (
CollectionElement
): The type of the values in the dict. - βdict_mutability (
Bool
): Whether the reference to the dict items is mutable. - βdict_lifetime (
AnyLifetime[$2.value]
): The lifetime of the dict items.
Args:
- βvalue (
_DictEntryIter[dict_mutability, K, V, dict_lifetime, 1]
): The dict items to get the reversed iterator of.
Returns:
The reversed iterator of the dict items.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?