Vajrasky Kok added the comment: I have played around with this test.
The major issue (there are other issues as well but not so difficult) is whether nlargest and nsmallest should support iterator that could be endless iterator or reject it (by checking __len__ attribute) straight away. Once we decide that, the fix should be not that hard. For example, I want to get 2 largest numbers from fibonacci number series. heapq.nlargest(2, fibonacci_iterator) => what is the answer for this? Exception or let it be stuck forever. ---------- nosy: +vajrasky _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19119> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com