[3.9] bpo-46732: fix __bool__ docstring (GH-31301) (GH-31474)

(cherry picked from commit 0a222db2bc)


Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-02-21 09:18:55 -08:00 committed by GitHub
parent 336a916f75
commit 8eb18d842c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
Correct the docstring for the :meth:`__bool__` method. Patch by Jelle
Zijlstra.

View File

@ -7236,7 +7236,7 @@ static slotdef slotdefs[] = {
UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
"abs(self)"),
UNSLOT("__bool__", nb_bool, slot_nb_bool, wrap_inquirypred,
"self != 0"),
"True if self else False"),
UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~self"),
BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"),
RBINSLOT("__rlshift__", nb_lshift, slot_nb_lshift, "<<"),