From 6cb87a812f5dbac7745ec2f1dae4373980206743 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 17 Oct 2024 19:21:43 -0700 Subject: [PATCH] Fix runtime error on python 3.11.0 (#4197) All generic types present in a Union must be parametrized on 3.11.0 if any other generic types in the union are parametrized. This appears to be a bug in 3.11.0, as the behavior is not observed in 3.11.1 or 3.10; fixing here as this is technically more correct anyway and avoids a crash. --- reflex/event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/event.py b/reflex/event.py index f93bc63d2..8291e3465 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1412,7 +1412,7 @@ class ToEventChainVarOperation(ToOperation, EventChainVar): G = ParamSpec("G") -IndividualEventType = Union[EventSpec, EventHandler, Callable[G, Any], Var] +IndividualEventType = Union[EventSpec, EventHandler, Callable[G, Any], Var[Any]] EventType = Union[IndividualEventType[G], List[IndividualEventType[G]]]