Skip to content

typing.Generic does not correctly call super().__init_subclass__ #77388

Closed

Description

@wrmsr
mannequin
BPO 33207
Nosy @gvanrossum, @ilevkivskyi, @wrmsr
PRs
  • bpo-33207: Call super in Generic.__init_subclass__ #6356
  • [3.7] bpo-33207: Call super in Generic.__init_subclass__ (GH-6356) #6372
  • Files
  • generic_init_subclass.py
  • 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 2018-04-04.16:55:29.967>
    created_at = <Date 2018-04-02.22:01:55.103>
    labels = ['3.7', 'type-bug', 'library']
    title = 'typing.Generic does not correctly call super().__init_subclass__'
    updated_at = <Date 2018-04-04.16:55:29.966>
    user = 'https://github.com/wrmsr'

    bugs.python.org fields:

    activity = <Date 2018-04-04.16:55:29.966>
    actor = 'levkivskyi'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-04-04.16:55:29.967>
    closer = 'levkivskyi'
    components = ['Library (Lib)']
    creation = <Date 2018-04-02.22:01:55.103>
    creator = 'wrmsr'
    dependencies = []
    files = ['47513']
    hgrepos = []
    issue_num = 33207
    keywords = ['patch']
    message_count = 1.0
    messages = ['314828']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'levkivskyi', 'wrmsr']
    pr_nums = ['6356', '6372']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue33207'
    versions = ['Python 3.7']

    Activity

    1. wrmsr commented on Apr 2, 2018

      wrmsrmannequin
      MannequinAuthor

      Per the docs ( https://docs.python.org/3/reference/datamodel.html#object.\_\_init_subclass__ ) this should be chain-calling super but currently doesn't, and thus breaks base classes listed after it which depend on this functionality. Attached a test for a real-world usecase of mine. Originally noted in https://bugs.python.org/issue32162? but on a new ticket as requested. Thanks :)

    2. added
      3.7 (EOL)
      stdlib
      type-bug
      on Apr 2, 2018
    3. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)stdlibtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions