faust
faust copied to clipboard
How do I get mypy to work with subtypes of Record
mypy fails to notice type mismatches in subclasses of faust.Record. However, the documentation explicitly mentions static typing and type checking and when going through the codebase, great care has been taken to annotate and cast.
Steps To Reproduce
define record_test.py
from faust import Record
class Point(Record):
x : int
y : int
def fun() -> None:
Point(x = "a",y="b")
run
mypy --strict record_test.py
Observed behavior
mypy --strict record_test.py
Success: no issues found in 1 source fil
Expected
I would expect mypy to report an error since a string is assigned to an int field.
Versions
- Python version 3.9
- Faust version
pip show faust-streaming
Name: faust-streaming
Version: 0.7.0
mypy --version
mypy 0.910