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
we had __getattr__ defined in Var, which made typing think "oh yea i could do this", but all it did was raise errors, so we thought it would be best to move it into a non-typing context
as an incident for this, Vars that would get downcasted to ObjectVar now would make a "false" alarm on how they don't have __getattr__
while we would like for Var (or something similar to it, maybe AutoVar) downcast to ObjectVar automatically, this is a restriction in the python typing system that wasn't resolved, so we don't have options other than to either type things as ObjectVar or require an additional function call, like .guess_type()
Activity
linear commentedon Mar 20, 2025
ENG-5166 A lot of wrong typing hints?
benedikt-bartscher commentedon Mar 21, 2025
The recent reflex updates broke ObjectVar typing again, for the 3rd time :/
You can mitigate it by annotating your vars with
ObjectVaror useyour_var.to(ObjectVar).adhami3310 commentedon Mar 21, 2025
we had
__getattr__defined inVar, which made typing think "oh yea i could do this", but all it did was raise errors, so we thought it would be best to move it into a non-typing contextas an incident for this, Vars that would get downcasted to
ObjectVarnow would make a "false" alarm on how they don't have__getattr__while we would like for
Var(or something similar to it, maybeAutoVar) downcast toObjectVarautomatically, this is a restriction in the python typing system that wasn't resolved, so we don't have options other than to either type things asObjectVaror require an additional function call, like.guess_type()adhami3310 commentedon Mar 21, 2025
the relevant ticket for this is python/typing#1273 once again