New submission from Prashant Sharma:
It would be more convenient to extend heapq to support user defined
comparators.
Default can be cmp_lt in which case they behave as they do now.
Caveat:
What happens if uses switches comparator between calls to push or pop. The
expected behavior can
Prashant Sharma added the comment:
Signed the PSF CLA.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20905
___
___
Python-bugs-list mailing
Prashant Sharma added the comment:
Hey Gareth,
add Key= approach also solves the purpose. The purpose is to be able to use
heapq as max heap too conveniently. (I just wish python had minmaxheap too, but
felt that is too much to ask for.) It is a very common usage and usual tricks
Prashant Sharma added the comment:
Did not knew about #13742. I hope it gets merged soon and may be, if possible
backport too ?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20905
Prashant Sharma added the comment:
Thanks Raymond for looking at the patch, understood your considerations are
reasonable. This discussion can be closed here.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20905
Prashant Sharma added the comment:
Should this change be done? If so, I would want to take up this issue.
--
nosy: +gutsytechster
___
Python tracker
<https://bugs.python.org/issue34