[New-bugs-announce] [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral

Rory Yorke report at bugs.python.org
Sat May 8 03:05:20 EDT 2021


New submission from Rory Yorke <rory.yorke at gmail.com>:

Checked at commit 42fcad2, HEAD of main circa 8 May 2021.

cpython/Doc/library/numbers.rst says numbers.Complex subtypes "include the operations [...] ``+``, ``-``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``"

and for numbers.Integral: "Adds abstract methods for ``**`` and"

However, in cpython/Lib/numbers.py, the class Complex has `__pow__` and `__rpow__` methods, which makes sense mathematically.  The numbers.Class docstring is also missing a mention of `**`.

class.Integral does define a three-argument __pow__ for three-argument pow().

----------
assignee: docs at python
components: Documentation
messages: 393240
nosy: docs at python, roryyorke
priority: normal
severity: normal
status: open
title: Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral
versions: Python 3.11

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


More information about the New-bugs-announce mailing list