Message370421
I'm -0 on this one.
Originally, there were no range checks at all. This kept the code small and fast which was important because bisect() is a building block sometimes used in tight loops, random.choices() for example.
Later, a test for negative lo values was added when it was shown that that case sometimes arose in practice. At that time, a check for negative hi value was skipped because it either didn't seem to arise in practice or that it would occur in conjunction with a negative lo value.
Another issue is that the C implementation already uses a default of -1 when hi=None. So adding another check, one that we likely don't really need, would be more invasive and complicated than it seems at first. |
|
Date |
User |
Action |
Args |
2020-05-31 09:56:38 | rhettinger | set | recipients:
+ rhettinger, samuel72 |
2020-05-31 09:56:38 | rhettinger | set | messageid: <1590918998.1.0.39164851186.issue40832@roundup.psfhosted.org> |
2020-05-31 09:56:38 | rhettinger | link | issue40832 messages |
2020-05-31 09:56:37 | rhettinger | create | |
|