Skip to content

Type[X] not compatible with metaclass of X #3326

Closed
@JukkaL

Description

@JukkaL

The second-to-last line should probably be accepted by mypy, but it currently generates an error because Type[A] isn't compatible with the metaclass of M:

from typing import Type

class M(type): pass
class A(metaclass=M): pass

a: Type[A] = A
m: M = a    # error, but should be okay
m2: M = A   # no error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions