New submission from George Sakkis george.sak...@gmail.com:
According to the docs, heapq.nlargest should be equivalent to
sorted(iterable, key=key, reverse=True)[:n], and since sorted() is
stable, so should heapq.nlargest be. This is not the case:
s =[
('Mike', -1),
('John', 3),
('George',
Changes by Georg Brandl ge...@python.org:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5697
___
___
DSM dsm...@users.sourceforge.net added the comment:
I can't reproduce in current python, and the relevant lines now look like
it = izip(iterable, count(0,-1))# decorate
it = izip(imap(key, in1), count(0,-1), in2) # decorate
It seems that these were
George Sakkis george.sak...@gmail.com added the comment:
Should have checked a recent version first; that's from 2.5 (r25:51908,
Sep 19 2006, 09:52:17). Sorry for the noise.
--
status: open - closed
___
Python tracker rep...@bugs.python.org