Skip to content

Commit c596ecb

Browse files
[3.10] bpo-46732: fix __bool__ docstring (GH-31301) (GH-31473)
(cherry picked from commit 0a222db) Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent 7da97f6 commit c596ecb

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
@@ -7996,7 +7996,7 @@ static slotdef slotdefs[] = {
79967996
UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
79977997
"abs(self)"),
79987998
UNSLOT("__bool__", nb_bool, slot_nb_bool, wrap_inquirypred,
7999-
"self != 0"),
7999+
"True if self else False"),
80008000
UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~self"),
80018001
BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"),
80028002
RBINSLOT("__rlshift__", nb_lshift, slot_nb_lshift, "<<"),

0 commit comments

Comments
 (0)