Browse Source

[3.10] bpo-46732: fix __bool__ docstring (GH-31301) (GH-31473)

(cherry picked from commit 0a222db2bc)


Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
pull/31485/head
Miss Islington (bot) 4 years ago
committed by GitHub
parent
commit
c596ecbf82
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Misc/NEWS.d/next/Core and Builtins/2022-02-12-11-16-40.bpo-46732.3Z_qxd.rst
  2. 2
      Objects/typeobject.c

2
Misc/NEWS.d/next/Core and Builtins/2022-02-12-11-16-40.bpo-46732.3Z_qxd.rst

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

2
Objects/typeobject.c

@ -7996,7 +7996,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, "<<"),

Loading…
Cancel
Save