mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-16 11:34:56 +08:00
Use PEP 604 syntax wherever possible (#7493)
This commit is contained in:
@@ -5,20 +5,7 @@ from importlib.abc import PathEntryFinder
|
||||
from importlib.machinery import ModuleSpec
|
||||
from io import TextIOWrapper
|
||||
from types import FrameType, ModuleType, TracebackType
|
||||
from typing import (
|
||||
Any,
|
||||
AsyncGenerator,
|
||||
Callable,
|
||||
Coroutine,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Protocol,
|
||||
Sequence,
|
||||
TextIO,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, AsyncGenerator, Callable, Coroutine, NoReturn, Protocol, Sequence, TextIO, TypeVar, Union, overload
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@@ -255,7 +242,7 @@ _ProfileFunc = Callable[[FrameType, str, Any], Any]
|
||||
def getprofile() -> _ProfileFunc | None: ...
|
||||
def setprofile(profilefunc: _ProfileFunc | None) -> None: ...
|
||||
|
||||
_TraceFunc = Callable[[FrameType, str, Any], Optional[Callable[[FrameType, str, Any], Any]]]
|
||||
_TraceFunc = Callable[[FrameType, str, Any], Callable[[FrameType, str, Any], Any] | None]
|
||||
|
||||
def gettrace() -> _TraceFunc | None: ...
|
||||
def settrace(tracefunc: _TraceFunc | None) -> None: ...
|
||||
@@ -322,7 +309,7 @@ if sys.version_info >= (3, 8):
|
||||
def addaudithook(hook: Callable[[str, tuple[Any, ...]], Any]) -> None: ...
|
||||
def audit(__event: str, *args: Any) -> None: ...
|
||||
|
||||
_AsyncgenHook = Optional[Callable[[AsyncGenerator[Any, Any]], None]]
|
||||
_AsyncgenHook = Callable[[AsyncGenerator[Any, Any]], None] | None
|
||||
|
||||
@final
|
||||
class _asyncgen_hooks(structseq[_AsyncgenHook], tuple[_AsyncgenHook, _AsyncgenHook]):
|
||||
|
||||
Reference in New Issue
Block a user