[issue44571] itertools: takedowhile()

pavel-lexyr report at bugs.python.org
Mon Jul 5 18:33:28 EDT 2021


New submission from pavel-lexyr <pavel at lexyr.com>:

As described in the documentation, itertools.takewhile() returns all the elements until the first one that does not match the provided criterion. In case of a destructive iterator, or one with side effects, not yielding an element downstream may render takewhile() unsuitable for use.

Proposed is itertools.takedowhile() - an alternate function that yields the first false element as well, and returns after. The behaviour is identical otherwise.

----------
messages: 397025
nosy: pavel-lexyr, rhettinger
priority: normal
severity: normal
status: open
title: itertools: takedowhile()
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44571>
_______________________________________


More information about the Python-bugs-list mailing list