From 4fe8f1ad1585bcf3d860a2078115f71876daf41a Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 15 Oct 2024 16:54:04 -0700 Subject: [PATCH] EventCallback descriptor always returns EventSpec from class Relax actual `__get__` definition to support the multitude of overloads --- reflex/event.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reflex/event.py b/reflex/event.py index 862892a2e..4b0bf96e2 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1440,19 +1440,19 @@ if sys.version_info >= (3, 10): @overload def __get__( self: EventCallback[[V], T], instance: None, owner - ) -> Callable[[Union[Var[V], V]], T]: ... + ) -> Callable[[Union[Var[V], V]], EventSpec]: ... @overload def __get__( self: EventCallback[[V, V2], T], instance: None, owner - ) -> Callable[[Union[Var[V], V], Union[Var[V2], V2]], T]: ... + ) -> Callable[[Union[Var[V], V], Union[Var[V2], V2]], EventSpec]: ... @overload def __get__( self: EventCallback[[V, V2, V3], T], instance: None, owner ) -> Callable[ [Union[Var[V], V], Union[Var[V2], V2], Union[Var[V3], V3]], - T, + EventSpec, ]: ... @overload @@ -1465,7 +1465,7 @@ if sys.version_info >= (3, 10): Union[Var[V3], V3], Union[Var[V4], V4], ], - T, + EventSpec, ]: ... @overload @@ -1479,13 +1479,13 @@ if sys.version_info >= (3, 10): Union[Var[V4], V4], Union[Var[V5], V5], ], - T, + EventSpec, ]: ... @overload def __get__(self, instance, owner) -> Callable[P, T]: ... - def __get__(self, instance, owner) -> Callable[P, T]: + def __get__(self, instance, owner) -> Callable: """Get the function with the instance bound to it. Args: