Glossary: Data Structures and Algorithms
bisect
Also written: bisect module, bisect_left, bisect_right
A Python module with tested binary searches. `bisect_left(items, x)` returns the index where x would go in the sorted list (the first copy if present), and `bisect_right` returns the index after any copies.