Skip to content

Commit

Permalink
fixup: try to fix NotRequired, Required, TypeGuard
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Apr 20, 2024
1 parent 51c719c commit dfbde05
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugin/core/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
final, # noqa: F401
)



if sys.version_info >= (3, 11):
from enum import StrEnum # noqa: F401
from typing import (
Expand All @@ -36,11 +38,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
Expand All @@ -50,8 +53,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

0 comments on commit dfbde05

Please sign in to comment.