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 pavel-lexyr, rhettinger, serhiy.storchaka, tim.peters
Date 2021-07-12.16:40:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626108043.17.0.52674340419.issue44571@roundup.psfhosted.org>
In-reply-to
Content
That said, if you really do want those semantics, it's easy to build on top of Raymond's API:

def takewhile_plus_one_more_if_any(pred, iterable):
    from itertools import islice, chain
    before, after = before_and_after(pred, iterable)
    return chain(before, islice(after, 1))
History
Date User Action Args
2021-07-12 16:40:43tim.peterssetrecipients: + tim.peters, rhettinger, serhiy.storchaka, pavel-lexyr
2021-07-12 16:40:43tim.peterssetmessageid: <1626108043.17.0.52674340419.issue44571@roundup.psfhosted.org>
2021-07-12 16:40:43tim.peterslinkissue44571 messages
2021-07-12 16:40:43tim.peterscreate