python versions of bisect_right and bisect_left can fail guarantees #125889
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
extension-modules
C modules in the Modules dir
stdlib
Python modules in the Lib dir
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
The documentation for bisect.bisect_right and bisect.bisect_left states in both cases that
But in the python version of bisect, that guarantee can fail:
Attempt this online
Outputs :
I think there is an extra check in the C version for hi < 0.
CPython versions tested on:
3.13
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: