Skip to content

Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor #85074

@ezyang

Description

@ezyang
mannequin
BPO 40897
Nosy @gvanrossum, @ambv, @ezyang, @serhiy-storchaka, @1st1, @jonathanslenders, @hongweipeng, @miss-islington, @mauvilsa, @FFY00
PRs
  • bpo-40897:Give priority to using the current class constructor in inspect.signature #23336
  • bpo-40897:Give priority to using the current class constructor in inspect.signature #27177
  • [3.10] bpo-40897:Give priority to using the current class constructor in inspect.signature (GH-27177) #27189
  • [3.9] bpo-40897: Partially backport GH-22583's refactor of inspect.py to allow bugfix backports #27193
  • [3.9] bpo-40897:Give priority to using the current class constructor in inspect.signature (GH-27177) #27209
  • 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-07-17.08:37:04.648>
    created_at = <Date 2020-06-07.03:37:38.227>
    labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
    title = 'Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor'
    updated_at = <Date 2021-07-17.08:37:04.647>
    user = 'https://github.com/ezyang'

    bugs.python.org fields:

    activity = <Date 2021-07-17.08:37:04.647>
    actor = 'lukasz.langa'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-17.08:37:04.648>
    closer = 'lukasz.langa'
    components = ['Library (Lib)']
    creation = <Date 2020-06-07.03:37:38.227>
    creator = 'ezyang'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40897
    keywords = ['patch']
    message_count = 17.0
    messages = ['370870', '370888', '370958', '370970', '371023', '387139', '387184', '397248', '397470', '397606', '397617', '397619', '397623', '397633', '397705', '397708', '397709']
    nosy_count = 11.0
    nosy_names = ['gvanrossum', 'lukasz.langa', 'ezyang', 'serhiy.storchaka', 'yselivanov', 'ralf.gommers', 'jonathan.slenders', 'hongweipeng', 'miss-islington', 'mauvilsa', 'FFY00']
    pr_nums = ['23336', '27177', '27189', '27193', '27209']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40897'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10only security fixes3.11only security fixes3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions