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
Pyright types an optional set or list computed var as ComputedVar, not SetVar or ArrayVar #7827
A computed var that returns an optional set or list has no ComputedVar.__get__ overload. Pyright types it as ComputedVar[...], not as SetVar or ArrayVar, so a set or array operation on it is a type error. At runtime the var works. A state field with the same type works in pyright too.
S.opt_set types as SetVar and S.opt_list as ArrayVar, the same as a non-optional computed var (-> set[str] gives SetVar[set[str]]).
Suggested fix
Add __get__ overloads for set[T] | None, frozenset[T] | None and list[T] | None to ComputedVar and AsyncComputedVar in reflex_base/vars/base.py, next to the existing set[LIST_INSIDE] overloads.
Activity
linear-code commentedon Nov 11, 2026
ENG-13966
Treat None as an empty list in optional ArrayVar operations; type opt…
Treat None as empty in optional set and list var operations (#7800)
Treat None as empty in optional set and list var operations (reflex-d…