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

duplicated signature of dataclass in help() #85587

Open
sir-sigurd mannequin opened this issue Jul 28, 2020 · 1 comment
Open

duplicated signature of dataclass in help() #85587

sir-sigurd mannequin opened this issue Jul 28, 2020 · 1 comment
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@sir-sigurd
Copy link
Mannequin

sir-sigurd mannequin commented Jul 28, 2020

BPO 41415
Nosy @sir-sigurd
PRs
  • bpo-41415: Remove duplicated signature from help() on dataclass #21652
  • 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 = None
    created_at = <Date 2020-07-28.04:39:59.072>
    labels = ['type-bug', 'library', '3.10']
    title = 'duplicated signature of dataclass in help()'
    updated_at = <Date 2020-07-28.04:41:25.198>
    user = 'https://github.com/sir-sigurd'

    bugs.python.org fields:

    activity = <Date 2020-07-28.04:41:25.198>
    actor = 'sir-sigurd'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-07-28.04:39:59.072>
    creator = 'sir-sigurd'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41415
    keywords = ['patch']
    message_count = 1.0
    messages = ['374461']
    nosy_count = 1.0
    nosy_names = ['sir-sigurd']
    pr_nums = ['21652']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue41415'
    versions = ['Python 3.10']

    @sir-sigurd
    Copy link
    Mannequin Author

    sir-sigurd mannequin commented Jul 28, 2020

    In [191]: import dataclasses, pydoc

    In [192]: @DataClass
    ...: class C:
    ...: pass
    ...:

    In [193]: print(pydoc.render_doc(C))
    Python Library Documentation: class C in module __main__

    class C(builtins.object)
     |  C() -> None
     |
     |  C()
     |
     |  Methods defined here:
     |
     ....

    It's duplicated because dataclass __doc__ defaults to signature:

    In [195]: C.__doc__
    Out[195]: 'C()'

    @sir-sigurd sir-sigurd mannequin added 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 28, 2020
    @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.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants