faust
faust copied to clipboard
Records are not checked by mypy
It looks like mypy
is treating every value of type faust.Record
as Any
: absolutely no type checking is done on them.
This is related to #233, but larger than only constructor arguments (who IIRC cannot be done properly without a mypy plugin).
Checklist
- [x] I have included information about relevant versions
- [x] I have verified that the issue persists when using the
master
branch of Faust.
Steps to reproduce
-
main.py
from faust import Record
class Example(Record):
x: int
Example(x=3).y
my_var: int = Example(x=3)
-
mypy main.py
Expected behavior
mypy should raise some errors
error: "Example" has no attribute "y"
error: Incompatible types in assignment (expression has type "Example", variable has type "int")
Actual behavior
mypy gives no error
Versions
OS: Linux Fedora 35
▶ python --version
Python 3.9.7
▶ pip show faust-streaming
Name: faust-streaming
Version: 0.8.4
▶ mypy --version
mypy 0.950 (compiled: yes)