[issue38626] small change at bisect_left function for easy understanding

2019-10-28 Thread miss-islington
miss-islington added the comment: New changeset 3c88199e0be352c0813f145d7c4c83af044268aa by Miss Skeleton (bot) (Raymond Hettinger) in branch 'master': bpo-38626: Add comment explaining why __lt__ is used. (GH-16978)

[issue38626] small change at bisect_left function for easy understanding

2019-10-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +16504 pull_request: https://github.com/python/cpython/pull/16978 ___ Python tracker ___

[issue38626] small change at bisect_left function for easy understanding

2019-10-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Tim. Thank you for the suggestion though. -- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue38626] small change at bisect_left function for easy understanding

2019-10-28 Thread Tim Peters
Tim Peters added the comment: So as far as possible, CPython only uses __lt__ ("<") element comparisons for its order-sensitive algorithms. This is documented for list.sort(), but the bisect and heapq modules strive to do the same. The point is to minimize the number of comparison methods

[issue38626] small change at bisect_left function for easy understanding

2019-10-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing

[issue38626] small change at bisect_left function for easy understanding

2019-10-28 Thread Windson Yang
New submission from Windson Yang : bisect_left should be similar to bisect_right. However, the current implement didn't reflect it. A little bit update for the bisect_left function could make the user easy to understand their relation. def bisect_left(a, x, lo=0, hi=None): if lo < 0: