[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: > issue4356 is also a good-enough solution for me, Then please leave this closed and let that issue run its course. Also, please don't take an argumentative tone or abuse setting the tracker status. -- status: open -> closed ___

[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread G
G added the comment: What do you propose to do for objects outside your project? Replace their __lt__ method with a context manager which replaces the original implementation, for lists at a time? __lt__ is not good enough as a one-way-to-do-it solution. issue4356 is also a good-enough soluti

[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, but we've intentionally removed generic compare functions in favor of objects supporting __lt__. That is now the one-way-to-do-it. If needed for convenience, you can use functools.cmp_to_key to automatically build a wrapper. -- resolution

[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread G
Change by G : -- keywords: +patch pull_requests: +13837 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13970 ___ Python tracker ___ __

[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: See also issue1451588. issue4356 for more discussion that also proposes to add key parameter. -- nosy: +xtreak ___ Python tracker

[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue37229] bisect: Allow a custom compare function

2019-06-11 Thread G
New submission from G : All of bisect's functions (insort_{left,right}, bisect_{left,right}) can only use comparison of objects via __lt__. They should support providing a custom comparison function. -- components: Library (Lib) messages: 345216 nosy: gpery priority: normal severity: n