Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: power operator (**) present for numbers.Complex, not added in numbers.Integral #88238

Closed
roryyorke mannequin opened this issue May 8, 2021 · 5 comments
Closed
Labels
3.11 only security fixes docs Documentation in the Doc dir

Comments

@roryyorke
Copy link
Mannequin

roryyorke mannequin commented May 8, 2021

BPO 44072
Nosy @terryjreedy, @miss-islington, @roryyorke
PRs
  • bpo-44072: fix Complex, Integral docs for ** #25986
  • [3.10] bpo-44072: fix Complex, Integral docs for ** (GH-25986) #26139
  • [3.9] bpo-44072: fix Complex, Integral docs for ** (GH-25986) #26140
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-05-14.23:07:54.587>
    created_at = <Date 2021-05-08.07:05:20.659>
    labels = ['3.11', 'docs']
    title = 'Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral'
    updated_at = <Date 2021-05-14.23:07:54.587>
    user = 'https://github.com/roryyorke'

    bugs.python.org fields:

    activity = <Date 2021-05-14.23:07:54.587>
    actor = 'terry.reedy'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-05-14.23:07:54.587>
    closer = 'terry.reedy'
    components = ['Documentation']
    creation = <Date 2021-05-08.07:05:20.659>
    creator = 'roryyorke'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44072
    keywords = ['patch']
    message_count = 5.0
    messages = ['393240', '393694', '393697', '393698', '393701']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'docs@python', 'miss-islington', 'roryyorke']
    pr_nums = ['25986', '26139', '26140']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44072'
    versions = ['Python 3.11']

    @roryyorke
    Copy link
    Mannequin Author

    roryyorke mannequin commented May 8, 2021

    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().

    @roryyorke roryyorke mannequin added the 3.11 only security fixes label May 8, 2021
    @roryyorke roryyorke mannequin assigned docspython May 8, 2021
    @roryyorke roryyorke mannequin added docs Documentation in the Doc dir 3.11 only security fixes labels May 8, 2021
    @roryyorke roryyorke mannequin assigned docspython May 8, 2021
    @roryyorke roryyorke mannequin added the docs Documentation in the Doc dir label May 8, 2021
    @terryjreedy
    Copy link
    Member

    Yes, complex ** complex works fine, and "TypeError: pow() 3rd argument not allowed unless all arguments are integers".

    @miss-islington
    Copy link
    Contributor

    New changeset 2e99869 by Miss Islington (bot) in branch '3.10':
    bpo-44072: fix Complex, Integral docs for ** (GH-25986)
    2e99869

    @miss-islington
    Copy link
    Contributor

    New changeset fa9de0c by Miss Islington (bot) in branch '3.9':
    bpo-44072: fix Complex, Integral docs for ** (GH-25986)
    fa9de0c

    @terryjreedy
    Copy link
    Member

    Thanks for the report and clean patch.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants