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 f6304e6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugin/core/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
final, # noqa: F401
)

if sys.version_info >= (3, 11):
if sys.version_info >= (3, 15):
from enum import StrEnum # noqa: F401
from typing import (
NotRequired, # noqa: F401
Expand All @@ -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
Expand All @@ -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

0 comments on commit f6304e6

Please sign in to comment.