Skip to content

gh-89682: [doc] reword docstring of __contains__ to clarify that it returns a bool #29043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reworded docstring of the default ``__contains__`` to clarify that it returns a :class:`bool`.
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
Expand Down