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
{{ message }}
Repository navigation
Normal State variable use causes call-arg and arg-type errors in mypy #3374
The errors include the following pattern for every Reflex Event handler:
reflex_mypy/reflex_mypy.py:24: error: Missing positional argument "arg"in call to "increment_by" of "State" [call-arg]
reflex_mypy/reflex_mypy.py:24: error: Argument 1 to "increment_by" of "State" has incompatible type"int"; expected "State" [arg-type]
I spoke with@picklelo on Discord and he confirmed that Reflex can't work with this aspect of Mypy right now. Here's a more formal writeup of the issue.
Expected behavior
The event handler line works correctly and as the Reflex docs say. I would expect Mypy not to raise an error on known-working code, but because Reflex' usage here is non-standard, it complains.
Specifics (please complete the following information):
Activity
adhami3310 commentedon Feb 5, 2025
The introduction of
rx.Fieldandrx.eventfixes the issue.