Use PEP 604 syntax wherever possible, part II (#7514)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Alex Waygood
2022-03-19 14:27:35 +00:00
committed by GitHub
parent 340c6c97ed
commit 1acc8f3bd6
55 changed files with 116 additions and 141 deletions

View File

@@ -1,5 +1,5 @@
from types import CodeType, FrameType, FunctionType, MethodType, ModuleType, TracebackType
from typing import Any, AnyStr, Callable, NamedTuple, Optional, Sequence, Union
from typing import Any, AnyStr, Callable, NamedTuple, Sequence, Union
# Types and members
class EndOfBlock(Exception): ...
@@ -106,7 +106,7 @@ class Traceback(NamedTuple):
code_context: list[str] | None
index: int | None # type: ignore[assignment]
_FrameInfo = tuple[FrameType, str, int, str, Optional[list[str]], Optional[int]]
_FrameInfo = tuple[FrameType, str, int, str, list[str] | None, int | None]
def getouterframes(frame: FrameType, context: int = ...) -> list[_FrameInfo]: ...
def getframeinfo(frame: FrameType | TracebackType, context: int = ...) -> Traceback: ...