From 70af4897473a1a26082d8d02e80c052277e598c7 Mon Sep 17 00:00:00 2001 From: Donggu Kang Date: Thu, 13 Mar 2025 18:48:07 +0900 Subject: [PATCH] Fix DecoratorBase typing --- qcore/decorators.pyi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qcore/decorators.pyi b/qcore/decorators.pyi index 0006e30..6482317 100644 --- a/qcore/decorators.pyi +++ b/qcore/decorators.pyi @@ -4,10 +4,10 @@ from typing import ( Callable, ContextManager, Generic, + Optional, Tuple, Type, TypeVar, - Optional, Union, ) @@ -32,7 +32,9 @@ class DecoratorBase(Generic[_T]): def is_decorator(self) -> bool: ... @abstractmethod def __call__(self, *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, owner: object, cls: Type[object]) -> DecoratorBinder[_T]: ... + def __get__( + self, owner: object, cls: Type[object] + ) -> Union[DecoratorBase[_T], DecoratorBinder[_T]]: ... def decorate( decorator_cls: Type[DecoratorBase[_T]], *args: Any, **kwargs: Any