mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Use PEP 604 syntax wherever possible (#7493)
This commit is contained in:
@@ -12,7 +12,6 @@ from typing import ( # noqa Y027
|
||||
Generator,
|
||||
Generic,
|
||||
Iterator,
|
||||
Optional,
|
||||
Protocol,
|
||||
TypeVar,
|
||||
overload,
|
||||
@@ -87,11 +86,11 @@ if sys.version_info >= (3, 7):
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_io = TypeVar("_T_io", bound=Optional[IO[str]])
|
||||
_T_io = TypeVar("_T_io", bound=IO[str] | None)
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
_ExitFunc = Callable[[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]], Optional[bool]]
|
||||
_ExitFunc = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], bool | None]
|
||||
_CM_EF = TypeVar("_CM_EF", AbstractContextManager[Any], _ExitFunc)
|
||||
|
||||
class ContextDecorator:
|
||||
@@ -190,7 +189,7 @@ class ExitStack(AbstractContextManager[ExitStack]):
|
||||
) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
_ExitCoroFunc = Callable[[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]], Awaitable[bool]]
|
||||
_ExitCoroFunc = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], Awaitable[bool]]
|
||||
_ACM_EF = TypeVar("_ACM_EF", AbstractAsyncContextManager[Any], _ExitCoroFunc)
|
||||
|
||||
class AsyncExitStack(AbstractAsyncContextManager[AsyncExitStack]):
|
||||
|
||||
Reference in New Issue
Block a user