Skip to content

mypy allows TypedDict classes with metaclasses #16432

@sobolevn

Description

@sobolevn
from typing import TypedDict

class A(type): ...

class Foo(TypedDict, metaclass=A):
   x: int

This code raises no errors in mypy. But, PEP says: https://peps.python.org/pep-0589/

Specifying a metaclass is not allowed.

I am working on a PR.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions