Message397336
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 ;-) |
|
Date |
User |
Action |
Args |
2021-07-12 16:30:50 | tim.peters | set | recipients:
+ tim.peters, rhettinger, serhiy.storchaka, pavel-lexyr |
2021-07-12 16:30:50 | tim.peters | set | messageid: <1626107450.64.0.190250786222.issue44571@roundup.psfhosted.org> |
2021-07-12 16:30:50 | tim.peters | link | issue44571 messages |
2021-07-12 16:30:50 | tim.peters | create | |
|