summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Savov <ivan.savov@gmail.com>2022-11-26 22:24:04 (GMT)
committerGitHub <noreply@github.com>2022-11-26 22:24:04 (GMT)
commit25bc115df9d0e82309852609a83b5ab7f804cdc1 (patch)
tree6c4232713449b9f3aeccc141d975531a03f4551a
parent7f005749b27c7b9108ea24e5c0ff25068910b75c (diff)
downloadcpython-25bc115df9d0e82309852609a83b5ab7f804cdc1.zip
cpython-25bc115df9d0e82309852609a83b5ab7f804cdc1.tar.gz
cpython-25bc115df9d0e82309852609a83b5ab7f804cdc1.tar.bz2
gh-89682: [doc] reword docstring of __contains__ to clarify that it returns a bool (GH-29043)
-rw-r--r--Misc/NEWS.d/next/Documentation/2022-11-26-21-43-05.gh-issue-89682.DhKoTM.rst1
-rw-r--r--Objects/typeobject.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Documentation/2022-11-26-21-43-05.gh-issue-89682.DhKoTM.rst b/Misc/NEWS.d/next/Documentation/2022-11-26-21-43-05.gh-issue-89682.DhKoTM.rst
new file mode 100644
index 0000000..46be065
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2022-11-26-21-43-05.gh-issue-89682.DhKoTM.rst
@@ -0,0 +1 @@
+Reworded docstring of the default ``__contains__`` to clarify that it returns a :class:`bool`.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index b993aa4..a4974a1 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -8741,7 +8741,7 @@ static pytype_slotdef slotdefs[] = {
SQSLOT(__delitem__, sq_ass_item, slot_sq_ass_item, wrap_sq_delitem,
"__delitem__($self, key, /)\n--\n\nDelete self[key]."),
SQSLOT(__contains__, sq_contains, slot_sq_contains, wrap_objobjproc,
- "__contains__($self, key, /)\n--\n\nReturn key in self."),
+ "__contains__($self, key, /)\n--\n\nReturn bool(key in self)."),
SQSLOT(__iadd__, sq_inplace_concat, NULL,
wrap_binaryfunc,
"__iadd__($self, value, /)\n--\n\nImplement self+=value."),