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:30:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626107450.64.0.190250786222.issue44571@roundup.psfhosted.org>
In-reply-to
Content
If you don't use the 'after` iterator, then of course you'll never see the values (if any) it would have yielded.

How could it possibly be otherwise? By design and construction, the `before` iterator ends before yielding the first (if any) transitional element.

As Raymond said at the start, the `takedowhile()` proposal appears much harder to use correctly, since there's no reasonably sane way to know that the last value it yields _is_ the transitional element (or, perhaps, that there was no transitional element, and the underlying iterable was just exhausted without finding one).

If the proposal were instead for `takewhile_plus_one_more_if_any()`, then at least the ugly name would warn about the surprising intended behavior ;-)
History
Date User Action Args
2021-07-12 16:30:50tim.peterssetrecipients: + tim.peters, rhettinger, serhiy.storchaka, pavel-lexyr
2021-07-12 16:30:50tim.peterssetmessageid: <1626107450.64.0.190250786222.issue44571@roundup.psfhosted.org>
2021-07-12 16:30:50tim.peterslinkissue44571 messages
2021-07-12 16:30:50tim.peterscreate