]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-89682: [doc] reword docstring of __contains__ to clarify that it returns a bool...
authorIvan Savov <ivan.savov@gmail.com>
Sat, 26 Nov 2022 22:24:04 +0000 (17:24 -0500)
committerGitHub <noreply@github.com>
Sat, 26 Nov 2022 22:24:04 +0000 (22:24 +0000)
Misc/NEWS.d/next/Documentation/2022-11-26-21-43-05.gh-issue-89682.DhKoTM.rst [new file with mode: 0644]
Objects/typeobject.c

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 (file)
index 0000000..46be065
--- /dev/null
@@ -0,0 +1 @@
+Reworded docstring of the default ``__contains__`` to clarify that it returns a :class:`bool`.
index b993aa405f6b6aaf739f0513d764b9ae372d612d..a4974a1b4f7113372f8f2f105cfac4f7200bd5e1 100644 (file)
@@ -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."),