python / python/cpython

The doc of `itertools.filterfalse()` shows `predicate` argument but the docstring shows `function` argument

Đang mở
#138,186 5 bình luận 0 reaction 1 người được giao Xem trên GitHub

@rhettinger đang làm issue này rồi.

Từ ngày 28/8/2025.

docs
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

The doc of itertools.filterfalse() shows predicate argument as shown below:

itertools.filterfalse(predicate, iterable)

But the docstring of itertools.filterfalse() shows function argument instead of predicate argument as shown below:

from itertools import filterfalse

print(help(filterfalse))
# class filterfalse(builtins.object)
#  |  filterfalse(function, iterable, /)
# ...

So the docstring of itertools.filterfalse() should show predicate argument instead of function argument for consistency as shown below:

from itertools import filterfalse

print(help(filterfalse))
# class filterfalse(builtins.object)
#  |  filterfalse(predicate, iterable, /)
# ...

In addition, both the doc and docstring of itertools.takewhile() properly show predicate argument as shown below:

itertools.takewhile(predicate, iterable)

from itertools import takewhile

print(help(takewhile))
# class takewhile(builtins.object)
#  |  takewhile(predicate, iterable, /)
#  ...

And, both the doc and docstring of itertools.dropwhile() properly show predicate argument as shown below:

itertools.dropwhile(predicate, iterable)

from itertools import dropwhile

print(help(dropwhile))
# class dropwhile(builtins.object)
#  |  dropwhile(predicate, iterable, /)
# ...
Linked PRs
  • gh-144451

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.