stdlib: Audit Callable[<parameters>, None] annotations (#8187)

This commit is contained in:
Alex Waygood
2022-06-27 07:08:28 +01:00
committed by GitHub
parent 0178a0e742
commit 8b3b6bf7cd
21 changed files with 59 additions and 66 deletions

View File

@@ -1,5 +1,5 @@
import sys
from _typeshed import OptExcInfo, structseq
from _typeshed import OptExcInfo, ProfileFunction, TraceFunction, structseq
from builtins import object as _object
from collections.abc import AsyncGenerator, Callable, Coroutine, Sequence
from importlib.abc import PathEntryFinder
@@ -241,16 +241,10 @@ def getsizeof(obj: object) -> int: ...
@overload
def getsizeof(obj: object, default: int) -> int: ...
def getswitchinterval() -> float: ...
_ProfileFunc: TypeAlias = Callable[[FrameType, str, Any], Any]
def getprofile() -> _ProfileFunc | None: ...
def setprofile(profilefunc: _ProfileFunc | None) -> None: ...
_TraceFunc: TypeAlias = Callable[[FrameType, str, Any], Callable[[FrameType, str, Any], Any] | None]
def gettrace() -> _TraceFunc | None: ...
def settrace(tracefunc: _TraceFunc | None) -> None: ...
def getprofile() -> ProfileFunction | None: ...
def setprofile(profilefunc: ProfileFunction | None) -> None: ...
def gettrace() -> TraceFunction | None: ...
def settrace(tracefunc: TraceFunction | None) -> None: ...
if sys.platform == "win32":
# A tuple of length 5, even though it has more than 5 attributes.