Issue 28593: Inconsistent itertools' predicate behaviour (original) (raw)

Created on 2016-11-03 02:38 by franciscouzo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg279960 - (view) Author: Francisco Couzo (franciscouzo) * Date: 2016-11-03 02:38
As per Terry's recommendation https://mail.python.org/pipermail/python-dev/2016-November/146791.html Currently some functions in itertools (dropwhile and takewhile), don't accept None as a predicate, but filterfalse and groupby do. I'd like your input, and I'm interested in writing a patch.
msg280092 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-11-04 21:54
I think that the simpler signature is better, that the None argument isn't clear, and that there aren't use cases that warrant and API churn. On your last post, it seemed that you were withdrawing the request. Can this tracker item be closed now?
msg280095 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-04 22:29
Note that the predicate is optional argument in groupby but mandatory in dropwhile and takewhile. I suppose that filter and filterfalse accept None for historical reason (they precede bool).
msg280096 - (view) Author: Francisco Couzo (franciscouzo) * Date: 2016-11-04 23:10
I think removing None as a valid predicate to filterfalse would make the API simpler, but I don't know if it's worth the API change, please do close the issue if you think it's not worth it.
History
Date User Action Args
2022-04-11 14:58:39 admin set github: 72779
2016-11-05 05:28:05 rhettinger set status: open -> closedresolution: rejected
2016-11-04 23:10:34 franciscouzo set messages: +
2016-11-04 22:29:29 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2016-11-04 21:54:36 rhettinger set messages: +
2016-11-04 21:54:27 rhettinger set messages: -
2016-11-04 21:47:01 rhettinger set assignee: rhettingermessages: + components: + Extension Modulesversions: + Python 3.7
2016-11-03 02:38:15 franciscouzo create