aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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 00000000000..46be065b653
--- /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 b993aa405f6..a4974a1b4f7 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."),