You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ mypy src/state_machine/zoran/check_mypy.py
src/state_machine/zoran/check_mypy.py:86: error: "Device" has no attribute "new_current" [attr-defined]
src/state_machine/zoran/check_mypy.py:87: error: "Device" has no attribute "new_current" [attr-defined]
src/state_machine/zoran/check_mypy.py:100: error: "Device" has no attribute "new_current" [attr-defined]
src/state_machine/zoran/check_mypy.py:101: error: "Device" has no attribute "new_current" [attr-defined]
Found 4 errors in 1 file (checked 1 source file)
To mitigate it I thought that I just have to add commented lines (in essence use model_override=True, and prepare some methods) and that will help.
But If I uncomment the lines, when I run the code I get:
This code works fine:
but mypy complains:
To mitigate it I thought that I just have to add commented lines (in essence use model_override=True, and prepare some methods) and that will help.
But If I uncomment the lines, when I run the code I get:
I used procedure described at https://github.com/pytransitions/transitions?tab=readme-ov-file#-typing-support, but maybe I have missed something.
I am also not sure if I need
def trigger(self, trigger_name: str) -> bool:
in my model ordef new_current(self, current: float) -> bool:
is enough.Expected behavior
I expect mypy not to show any errors if lines are uncommented and to be able to run the code with no errors.
Additional context
I am using:
Python 3.11.9
mypy 1.11.2 (compiled: yes)
transitions 0.9.2
The text was updated successfully, but these errors were encountered: