Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40832>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to