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
masenf@minicone repro-type-variable % pyright repro_type_variable/repro_type_variable.py/Users/masenf/code/reflex-dev/repro-type-variable/repro_type_variable/repro_type_variable.py /Users/masenf/code/reflex-dev/repro-type-variable/repro_type_variable/repro_type_variable.py:7:28 - error: Variable not allowed in type expression (reportInvalidTypeForm)1 error, 0 warnings, 0 informations
Expected behavior
Anything that needs to be used in a type expression must be defined statically at module level, NOT in a namespace like rx.event. We need to find another way to allow access to these types, like EventSpec, EventHandler, etc, without going through the EventNamespace
classEventNamespace(types.SimpleNamespace):
"""A namespace for event related classes."""Event=EventEventHandler=EventHandlerEventSpec=EventSpecCallableEventSpec=CallableEventSpecEventChain=EventChainEventVar=EventVarLiteralEventVar=LiteralEventVarEventChainVar=EventChainVarLiteralEventChainVar=LiteralEventChainVarEventType=EventTypeEventCallback=EventCallback
☝️ this doesn't work with pyright.
There might be a way to hack this with a .pyi file, haven't tried. Although maybe it's better to just doc and move on?
Specifics (please complete the following information):
Python Version: 3.11
Reflex Version: 0.6.5a
OS: macos
The text was updated successfully, but these errors were encountered:
Describe the bug
error: Variable not allowed in type expression (reportInvalidTypeForm)
To Reproduce
Expected behavior
Anything that needs to be used in a type expression must be defined statically at module level, NOT in a namespace like
rx.event
. We need to find another way to allow access to these types, likeEventSpec
,EventHandler
, etc, without going through theEventNamespace
☝️ this doesn't work with pyright.
There might be a way to hack this with a .pyi file, haven't tried. Although maybe it's better to just doc and move on?
Specifics (please complete the following information):
The text was updated successfully, but these errors were encountered: