Skip to content

gh-138186: Use 'predicate' instead of 'function' in filterfalse docstring#144451

Closed
kovan wants to merge 1 commit intopython:mainfrom
kovan:gh-138186-filterfalse-predicate
Closed

gh-138186: Use 'predicate' instead of 'function' in filterfalse docstring#144451
kovan wants to merge 1 commit intopython:mainfrom
kovan:gh-138186-filterfalse-predicate

Conversation

@kovan
Copy link
Contributor

@kovan kovan commented Feb 3, 2026

Summary

  • Changes the parameter name in itertools.filterfalse's docstring from function to predicate
  • This makes it consistent with:
    • The RST documentation (Doc/library/itertools.rst) which already uses predicate
    • The similar functions dropwhile and takewhile which use predicate

Before:

>>> help(itertools.filterfalse)
filterfalse(function, iterable, /)

After:

>>> help(itertools.filterfalse)
filterfalse(predicate, iterable, /)

Test plan

  • make check passed

🤖 Generated with Claude Code

… 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>
@bedevere-app
Copy link

bedevere-app bot commented Feb 3, 2026

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 skip news label instead.

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@bedevere-app
Copy link

bedevere-app bot commented Feb 4, 2026

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@picnixz
Copy link
Member

picnixz commented Feb 4, 2026

Since we still haven't reached a consensus on the issue, I'm closing it for now.

@picnixz picnixz closed this Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants