gh-138186: Use 'predicate' instead of 'function' in filterfalse docstring#144451
gh-138186: Use 'predicate' instead of 'function' in filterfalse docstring#144451kovan wants to merge 1 commit intopython:mainfrom
Conversation
… docstring Change the parameter name in itertools.filterfalse's docstring from 'function' to 'predicate' for consistency with the RST documentation and with similar functions dropwhile and takewhile. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
picnixz
left a comment
There was a problem hiding this comment.
It's not about dropwhile/takewhile, but about filter/filterfalse. See #138186 (comment). And again, read the issue before opening PRs. IMO, semantically, predicate is more correct but at runtime, we don't require the predicate to return a boolean as we use truthiness (predicates should really be boolean functions).
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Since we still haven't reached a consensus on the issue, I'm closing it for now. |
Summary
itertools.filterfalse's docstring fromfunctiontopredicateDoc/library/itertools.rst) which already usespredicatedropwhileandtakewhilewhich usepredicateBefore:
After:
Test plan
make checkpassed🤖 Generated with Claude Code
itertools.filterfalse()showspredicateargument but the docstring showsfunctionargument #138186