Skip to content

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

Closed
@gvanrossum

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

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