New submission from pavel-lexyr <pa...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue44571>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to