This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Claudiu.Popa, oscarbenjamin, rhettinger, serhiy.storchaka
Date 2013-09-08.19:14:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1378667700.26.0.114538791872.issue18821@psf.upfronthosting.co.za>
In-reply-to
Content
Oscar, the solution proposed by Serhiy looks like a better choice.

I'm wary of increasing the API complexity of the itertools.  Right now, their learnability is aided by having simple signatures and no side-values.

The itertools are modeled on functional tools in other languages with mature APIs.  I look to those languages to provide an indication of whether proposed features are needed in practice.  AFAICT, there is no precedent for a takewhile-with-failed-value combo.

I appreciate your request (especially because it was accompanied by a use case) but am going to decline.  IMO, the module as a whole is better served by keeping the tools simple and clean. 

If an individual itertool doesn't have an exact fit to a particular use case, it may indicate that the programmer would be better served by a simple generator which can express the logic more cleanly than a tricked-out itertool with side-values.
History
Date User Action Args
2013-09-08 19:15:00rhettingersetrecipients: + rhettinger, Claudiu.Popa, serhiy.storchaka, oscarbenjamin
2013-09-08 19:15:00rhettingersetmessageid: <1378667700.26.0.114538791872.issue18821@psf.upfronthosting.co.za>
2013-09-08 19:15:00rhettingerlinkissue18821 messages
2013-09-08 19:14:59rhettingercreate