From 618908de72626ec14a1d4e42bcd8a5946c3492e3 Mon Sep 17 00:00:00 2001 From: kovan Date: Tue, 3 Feb 2026 23:07:53 +0100 Subject: [PATCH] gh-138186: Use 'predicate' instead of 'function' in filterfalse 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 --- Modules/clinic/itertoolsmodule.c.h | 8 ++++---- Modules/itertoolsmodule.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index 49816bfcb42fec..98cce3bbc968d9 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -871,12 +871,12 @@ itertools_compress(PyTypeObject *type, PyObject *args, PyObject *kwargs) } PyDoc_STRVAR(itertools_filterfalse__doc__, -"filterfalse(function, iterable, /)\n" +"filterfalse(predicate, iterable, /)\n" "--\n" "\n" -"Return those items of iterable for which function(item) is false.\n" +"Return those items of iterable for which predicate(item) is false.\n" "\n" -"If function is None, return the items that are false."); +"If predicate is None, return the items that are false."); static PyObject * itertools_filterfalse_impl(PyTypeObject *type, PyObject *func, PyObject *seq); @@ -980,4 +980,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=7f385837b13edbeb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a44797ba1e4a8cce input=a9049054013a1b77]*/ diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 8685eff8be65c3..6e57b54a4be1f2 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -3245,17 +3245,17 @@ typedef struct { /*[clinic input] @classmethod itertools.filterfalse.__new__ - function as func: object + predicate as func: object iterable as seq: object / -Return those items of iterable for which function(item) is false. +Return those items of iterable for which predicate(item) is false. -If function is None, return the items that are false. +If predicate is None, return the items that are false. [clinic start generated code]*/ static PyObject * itertools_filterfalse_impl(PyTypeObject *type, PyObject *func, PyObject *seq) -/*[clinic end generated code: output=55f87eab9fc0484e input=2d684a2c66f99cde]*/ +/*[clinic end generated code: output=55f87eab9fc0484e input=a7df36679f5f66d6]*/ { PyObject *it; filterfalseobject *lz;