From 7865cd197a4038768d67ef41071334314dd9a593 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 22 Oct 2024 11:54:07 -0700 Subject: [PATCH] simplify some code --- reflex/event.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/event.py b/reflex/event.py index fdab9650a..8a5189eea 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1515,7 +1515,7 @@ if sys.version_info >= (3, 10): @overload def __get__(self, instance, owner) -> Callable[P, T]: ... - def __get__(self, instance, owner) -> Callable: + def __get__(self, instance, owner) -> Callable: # type: ignore """Get the function with the instance bound to it. Args: @@ -1563,7 +1563,9 @@ IndividualEventType = Union[ EventSpec, EventHandler, Callable[G, Any], EventCallback[G, Any], Var[Any] ] -EventType = Union[IndividualEventType[G], List[IndividualEventType[G]]] +ItemOrList = Union[V, List[V]] + +EventType = ItemOrList[IndividualEventType[G]] class EventNamespace(types.SimpleNamespace):