Skip to content

Commit 25bc115

Browse files
authored
gh-89682: [doc] reword docstring of __contains__ to clarify that it returns a bool (GH-29043)
1 parent 7f00574 commit 25bc115

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reworded docstring of the default ``__contains__`` to clarify that it returns a :class:`bool`.

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8741,7 +8741,7 @@ static pytype_slotdef slotdefs[] = {
87418741
SQSLOT(__delitem__, sq_ass_item, slot_sq_ass_item, wrap_sq_delitem,
87428742
"__delitem__($self, key, /)\n--\n\nDelete self[key]."),
87438743
SQSLOT(__contains__, sq_contains, slot_sq_contains, wrap_objobjproc,
8744-
"__contains__($self, key, /)\n--\n\nReturn key in self."),
8744+
"__contains__($self, key, /)\n--\n\nReturn bool(key in self)."),
87458745
SQSLOT(__iadd__, sq_inplace_concat, NULL,
87468746
wrap_binaryfunc,
87478747
"__iadd__($self, value, /)\n--\n\nImplement self+=value."),

0 commit comments

Comments
 (0)