Bug Report
mypy accepts closed=True on TypedDicts before Python 3.15. I think this should be allowed in typing-only files, but not at runtime.
To Reproduce
from typing import TypedDict
class A(TypedDict, closed=True):
x: int
a: A = {"x": 5, "y": "5"} # E
Expected Behavior
An error when defining A.
Actual Behavior
No error when defining A.
Your Environment
Reproduced in mypy-play.
- Mypy version used: 2.3.0
- Mypy command-line flags: N/A
- Mypy configuration options from
mypy.ini (and other config files): N/A
- Python version used: 3.12
Bug Report
mypy accepts
closed=Trueon TypedDicts before Python 3.15. I think this should be allowed in typing-only files, but not at runtime.To Reproduce
Expected Behavior
An error when defining
A.Actual Behavior
No error when defining
A.Your Environment
Reproduced in mypy-play.
mypy.ini(and other config files): N/A