EventCallback descriptor always returns EventSpec from class
Relax actual `__get__` definition to support the multitude of overloads
This commit is contained in:
parent
98786d015d
commit
4fe8f1ad15
@ -1440,19 +1440,19 @@ if sys.version_info >= (3, 10):
|
|||||||
@overload
|
@overload
|
||||||
def __get__(
|
def __get__(
|
||||||
self: EventCallback[[V], T], instance: None, owner
|
self: EventCallback[[V], T], instance: None, owner
|
||||||
) -> Callable[[Union[Var[V], V]], T]: ...
|
) -> Callable[[Union[Var[V], V]], EventSpec]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(
|
def __get__(
|
||||||
self: EventCallback[[V, V2], T], instance: None, owner
|
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
|
@overload
|
||||||
def __get__(
|
def __get__(
|
||||||
self: EventCallback[[V, V2, V3], T], instance: None, owner
|
self: EventCallback[[V, V2, V3], T], instance: None, owner
|
||||||
) -> Callable[
|
) -> Callable[
|
||||||
[Union[Var[V], V], Union[Var[V2], V2], Union[Var[V3], V3]],
|
[Union[Var[V], V], Union[Var[V2], V2], Union[Var[V3], V3]],
|
||||||
T,
|
EventSpec,
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
@ -1465,7 +1465,7 @@ if sys.version_info >= (3, 10):
|
|||||||
Union[Var[V3], V3],
|
Union[Var[V3], V3],
|
||||||
Union[Var[V4], V4],
|
Union[Var[V4], V4],
|
||||||
],
|
],
|
||||||
T,
|
EventSpec,
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
@ -1479,13 +1479,13 @@ if sys.version_info >= (3, 10):
|
|||||||
Union[Var[V4], V4],
|
Union[Var[V4], V4],
|
||||||
Union[Var[V5], V5],
|
Union[Var[V5], V5],
|
||||||
],
|
],
|
||||||
T,
|
EventSpec,
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(self, instance, owner) -> Callable[P, T]: ...
|
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.
|
"""Get the function with the instance bound to it.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
Loading…
Reference in New Issue
Block a user