-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
python/mypy
#13078Description
Surprized to find that dataclasses which contain floats do not work
"""compiletest.py"""
from dataclasses import dataclass
@dataclass
class TestClass:
x: float
y: float
name: str
def run():
foo = TestClass(x=1.0, y=2.2, name="fred")
print(foo)simply running mypyc compiletest.py and using it with
"""main.py"""
import compiletest
if __name__ == "__main__":
compiletest.run()erros with
Traceback (most recent call last):
File "main.py", line 1, in <module>
import compiletest
File "compiletest.py", line 5, in <module>
x: float
KeyError: 'float'
Metadata
Metadata
Assignees
Labels
No labels