Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

Thanks for the suggestion.  I agree that the loss of the non-matching element 
is an irritant.  The suggestion to return the first false element would solve 
that problem but is itself hard to work with.  The result would be difficult to 
reason about because all the elements are except one are true, the last is 
false, and you can't know that you have gotten a false element until one more 
call to next() to determine that no more elements are forthcoming.

Also, I'm reluctant to create any variants for takewhile() or dropwhile().  
Those have been the least successful itertools.  If I had it to do over again, 
they would not have been included.  For the most part, generator based 
solutions are superior in terms of readability, flexibility, and performance.

----------
assignee:  -> rhettinger

_______________________________________
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