[New-bugs-announce] [issue46978] Doc strings for built-in, in-place operators are misleading

Nicko van Someren report at bugs.python.org
Thu Mar 10 14:36:25 EST 2022


New submission from Nicko van Someren <nicko at nicko.org>:

Objects/typeobject.c uses slots to implement various operators and the IBSLOT macro is used to define slot entries for in-place binary operators. This macro creates a __doc__ string for the operators of the form "Return self<op>value."

This doc string is misleading since an in-place operator statement can not be used as an L-value, so nothing is "returned".

To fix this, the macro definition for IBSLOT should be updated to use a different word or phrase, such as "Compute self<op>value."

----------
components: Interpreter Core
messages: 414876
nosy: nickovs
priority: normal
severity: normal
status: open
title: Doc strings for built-in, in-place operators are misleading
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46978>
_______________________________________


More information about the New-bugs-announce mailing list