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 be unpredictable and should be obvious to the user of the 
API. It might also be good to state this obvious, if people here agree. 

P.S. I am really new to python world, forgive me for any kind of stupidity. 
Criticism and comments is what I am looking for here !

----------
components: Library (Lib)
files: heapq_com.patch
keywords: patch
messages: 213361
nosy: Prashant.Sharma
priority: normal
severity: normal
status: open
title: Adapt heapq push/pop/replace to allow passing a comparator.
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file34388/heapq_com.patch

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

Reply via email to