This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients rhettinger, samuel72
Date 2020-05-31.09:56:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590918998.1.0.39164851186.issue40832@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-05-31 09:56:38rhettingersetrecipients: + rhettinger, samuel72
2020-05-31 09:56:38rhettingersetmessageid: <1590918998.1.0.39164851186.issue40832@roundup.psfhosted.org>
2020-05-31 09:56:38rhettingerlinkissue40832 messages
2020-05-31 09:56:37rhettingercreate