rindex
This package provides rindex()
function that returns last index of value in sequence.
Installing
pip install rindex
Examples
from rindex import rindex
numbers = [5, 1, 3, 8, 10, 5, 8, 1, 8, 3]
print(rindex(numbers, 1))
print(rindex(numbers, 8, 4, 8))
Goals
Supported platforms
Currently, the library includes three rindex()
implementations:
Features
Controlling Cython extensions
You can set environment variable ENABLE_RINDEX_EXTENSIONS
to 0
or 1
to forcefully disable/enable Cython extensions.
This can be useful if you face compilation problems and want to use pure Python version.
Benchmarking
tests/benchmark.py
can generate interactive plots with comparisons of different implementations.