This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients remi.lapeyre, rhettinger, serhiy.storchaka, tim.peters
Date 2020-04-09.15:03:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586444597.64.0.697865479489.issue40239@roundup.psfhosted.org>
In-reply-to
Content
Serhiy, are you aware of heapq.merge()?  If not, look it up.  And then if you still think merge_sorted() would differ in some way, please spell out how it would differ.

Based on what you wrote, you threw an invalid invocation of tee() into the mix for some reason, which heapq.merge() certainly doesn't do.

And it's impossible to keep a small bound on memory use when reverse=True if you want it return the same sequence as sorted(... reverse=True).  Instead, for heapq.merge().

"""
reverse is a boolean value. If set to True, then the input elements are merged as if each comparison were reversed. To achieve behavior similar to sorted(itertools.chain(*iterables), reverse=True), all iterables must be sorted from largest to smallest.
"""
History
Date User Action Args
2020-04-09 15:03:17tim.peterssetrecipients: + tim.peters, rhettinger, serhiy.storchaka, remi.lapeyre
2020-04-09 15:03:17tim.peterssetmessageid: <1586444597.64.0.697865479489.issue40239@roundup.psfhosted.org>
2020-04-09 15:03:17tim.peterslinkissue40239 messages
2020-04-09 15:03:17tim.peterscreate