Closed as not planned
Description
Bug Report
mypy doesn't synthesize the __readonly_keys__
and __mutable_keys__
class attributes of TypedDict
, introduced in Python 3.13. This leads to stubtest complaining about each instance of a TypedDict
due to the attributes missing from the stubs.
To Reproduce
# foo.py
from typing import TypedDict
class Foo(TypedDict):
bar: str
print(Foo.__readonly_keys__) # at runtime: frozenset()
print(Foo.__mutable_keys__) # at runtime: frozenset({'bar'})
Expected Behavior
Using mypy --python-version 3.13 foo.py
: no errors.
Actual Behavior
foo.py:8: error: "type[Foo]" has no attribute "__readonly_keys__" [attr-defined]
foo.py:9: error: "type[Foo]" has no attribute "__mutable_keys__" [attr-defined]
Found 2 errors in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 1.15.0
- Mypy command-line flags: --python-version 3.13
- Mypy configuration options from
mypy.ini
(and other config files): ./. - Python version used: 3.12