mypyc
mypyc copied to clipboard
mypyc generates AttributeError: exception on basic use of InitVar
mypy version: 0.960 python version: 3.10.4 Running on Windows 11
just import the following code into a CPython REPL:
from dataclasses import InitVar, dataclass
@dataclass
class TestInitVar:
some_initvar: InitVar = None
def __post_init__(
self,
some_initvar,
):
pass
causes:
(.venv) PS C:\Projects\CaptureFile-MyPyC> python
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Test_01
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "Test_01.py", line 5, in <module>
class TestInitVar:
AttributeError: some_initvar
>>>