Skip to content

Commit

Permalink
Merge branch 'main' into feat/future-annotations-more
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcherng authored Apr 23, 2024
2 parents c6e86c7 + a3867f4 commit 5fd6c92
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions plugin/core/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@
cast,
final,
)
from typing_extensions import ( # noqa: F401
NotRequired,
ParamSpec,
Required,
TypeGuard,
)

if sys.version_info >= (3, 11):
from enum import StrEnum # noqa: F401
from typing import ( # noqa: F401
NotRequired,
ParamSpec,
Required,
TypeGuard,
)
else:
_T = TypeVar("_T")

class StrEnum(str, Enum):
"""
Naive polyfill for Python 3.11's StrEnum.
Expand All @@ -48,19 +46,3 @@ class StrEnum(str, Enum):

__format__ = str.__format__
__str__ = str.__str__

class NotRequired(Type, Generic[_T]): # type: ignore
pass

class ParamSpec(Type): # type: ignore
args = ...
kwargs = ...

def __init__(*args, **kwargs) -> None: # type: ignore
pass

class Required(Type, Generic[_T]): # type: ignore
pass

class TypeGuard(Type, Generic[_T]): # type: ignore
pass

0 comments on commit 5fd6c92

Please sign in to comment.