From 185644300657ed83ce7298d2c4ad142872fddbc8 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Sun, 21 Apr 2024 03:46:45 +0800 Subject: [PATCH] fixup: try to fix NotRequired, Required, TypeGuard Signed-off-by: Jack Cherng --- plugin/core/typing.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/core/typing.py b/plugin/core/typing.py index 5a3b23511..0fc98b923 100644 --- a/plugin/core/typing.py +++ b/plugin/core/typing.py @@ -36,11 +36,12 @@ TypeGuard, # noqa: F401 ) else: + _T = TypeVar("_T") class StrEnum(Type): # type: ignore pass - class NotRequired(Type): # type: ignore + class NotRequired(Type, Generic[_T]): # type: ignore pass class ParamSpec(Type): # type: ignore @@ -50,8 +51,8 @@ class ParamSpec(Type): # type: ignore def __init__(*args, **kwargs) -> None: # type: ignore pass - class Required(Type): # type: ignore + class Required(Type, Generic[_T]): # type: ignore pass - class TypeGuard(Type): # type: ignore + class TypeGuard(Type, Generic[_T]): # type: ignore pass