[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 56a3c0bc4634 by Raymond Hettinger in branch '2.7': Issue #19018: The heapq.merge() function no longer suppresses IndexError http://hg.python.org/cpython/rev/56a3c0bc4634 -- ___ Python tracker

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0ff5bb61c6a1 by Raymond Hettinger in branch '3.3': Issue #19018: The heapq.merge() function no longer suppresses IndexError http://hg.python.org/cpython/rev/0ff5bb61c6a1 -- nosy: +python-dev ___ Python tr

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin
Artem Fokin added the comment: Which branch should I add a unit-test to? Here is a patch that adds a unit-test to the current one. -- keywords: +patch Added file: http://bugs.python.org/file31760/unittest_patch.diff ___ Python tracker

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems like a good reason for a backport. Add a unittest and I'll take care of the rest. -- assignee: -> rhettinger ___ Python tracker

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread R. David Murray
R. David Murray added the comment: It was checked in as an optimization, but if it fixes a bug I don't see why it couldn't be backported. A unit test would be helpful, if you feel like writing one. -- nosy: +r.david.murray versions: -Python 3.1, Python 3.2 __

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +rhettinger, stutzbach ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin
Artem Fokin added the comment: Oh, it seems that in current cpython branch this problem is fixed by checking condition _len(h) > 1: http://hg.python.org/cpython/file/1dc925ee441a/Lib/heapq.py#l373 But is it possible to fix it for the previous branches? -- __

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin
Changes by Artem Fokin : -- versions: -3rd party, Python 2.6, Python 3.4, Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mail

[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin
New submission from Artem Fokin: Suppose we have the following code: from heapq import merge def iterable(): lst = range(10) for i in xrange(20): yield lst[i] it1, it2= iterable(), iterable() print list(merge(it1, it2)) # no IndexError #