Message397028
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. |
|
Date |
User |
Action |
Args |
2021-07-05 23:25:59 | rhettinger | set | recipients:
+ rhettinger, pavel-lexyr |
2021-07-05 23:25:59 | rhettinger | set | messageid: <1625527559.06.0.526238682294.issue44571@roundup.psfhosted.org> |
2021-07-05 23:25:59 | rhettinger | link | issue44571 messages |
2021-07-05 23:25:58 | rhettinger | create | |
|