Skip to content

Commit 0a222db

Browse files
fix __bool__ docstring (GH-31301)
1 parent 2cae938 commit 0a222db

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Correct the docstring for the :meth:`__bool__` method. Patch by Jelle
2+
Zijlstra.

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8065,7 +8065,7 @@ static slotdef slotdefs[] = {
80658065
UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
80668066
"abs(self)"),
80678067
UNSLOT("__bool__", nb_bool, slot_nb_bool, wrap_inquirypred,
8068-
"self != 0"),
8068+
"True if self else False"),
80698069
UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~self"),
80708070
BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"),
80718071
RBINSLOT("__rlshift__", nb_lshift, slot_nb_lshift, "<<"),

0 commit comments

Comments
 (0)