Skip to content

Direct "super" call of type.__init__ complains about type of first arg #3010

Closed

Description

@gvanrossum

Repro:

class M(type):
    def __init__(cls, name, base, attrs) -> None:
        type.__init__(cls, name, base, attrs)  # E: Argument 1 to "__init__" of "type" has incompatible type "M"; expected "type"

This appears to be a regression due to #2825 "Treat type equivalent to Type[Any]; fixes #2655" (@ilevkivskyi, reviewed by @ddfisher).

Activity

  1. ilevkivskyi commented on Mar 16, 2017

    @ilevkivskyi
    Member

    Yes, I remember I updated my PR after #2837 was merged, but I missed this corner case, sorry.

    Here is a fix #3012

  2. added a commit that references this issue on Mar 16, 2017
    aec4595
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

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions