I ran into this while trying out mypyc and managed to put together a minimal reproduction case:
import dataclasses
@dataclasses.dataclass
class A:
t: tuple[str, ...]
print(A(t=("hello", "world")).t)
runs as expected with CPython, but when imported after compiling with mypyc fails with:
Python 3.9.6 (default, Aug 6 2021, 00:27:57)
[Clang 12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sandbox
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sandbox.py", line 6, in <module>
t: tuple[str, ...]
KeyError: 'tuple'
>>>