Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions

View File

@@ -1,7 +1,7 @@
from bdb import Bdb
from cmd import Cmd
from types import FrameType, TracebackType
from typing import IO, Any, Callable, ClassVar, Dict, Iterable, List, Mapping, Tuple, TypeVar
from typing import IO, Any, Callable, ClassVar, Iterable, Mapping, TypeVar
_T = TypeVar("_T")
@@ -9,9 +9,9 @@ line_prefix: str # undocumented
class Restart(Exception): ...
def run(statement: str, globals: Dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(expression: str, globals: Dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> Any: ...
def runctx(statement: str, globals: Dict[str, Any], locals: Mapping[str, Any]) -> None: ...
def run(statement: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(expression: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> Any: ...
def runctx(statement: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> None: ...
def runcall(func: Callable[..., _T], *args: Any, **kwds: Any) -> _T | None: ...
def set_trace() -> None: ...
def post_mortem(t: TracebackType | None = ...) -> None: ...
@@ -20,19 +20,19 @@ def pm() -> None: ...
class Pdb(Bdb, Cmd):
# Everything here is undocumented, except for __init__
commands_resuming: ClassVar[List[str]]
commands_resuming: ClassVar[list[str]]
aliases: Dict[str, str]
aliases: dict[str, str]
mainpyfile: str
_wait_for_mainpyfile: bool
rcLines: List[str]
commands: Dict[int, List[str]]
commands_doprompt: Dict[int, bool]
commands_silent: Dict[int, bool]
rcLines: list[str]
commands: dict[int, list[str]]
commands_doprompt: dict[int, bool]
commands_silent: dict[int, bool]
commands_defining: bool
commands_bnum: int | None
lineno: int | None
stack: List[Tuple[FrameType, int]]
stack: list[tuple[FrameType, int]]
curindex: int
curframe: FrameType | None
curframe_locals: Mapping[str, Any]
@@ -47,11 +47,11 @@ class Pdb(Bdb, Cmd):
def displayhook(self, obj: object) -> None: ...
def handle_command_def(self, line: str) -> bool: ...
def defaultFile(self) -> str: ...
def lineinfo(self, identifier: str) -> Tuple[None, None, None] | Tuple[str, str, int]: ...
def lineinfo(self, identifier: str) -> tuple[None, None, None] | tuple[str, str, int]: ...
def checkline(self, filename: str, lineno: int) -> int: ...
def _getval(self, arg: str) -> object: ...
def print_stack_trace(self) -> None: ...
def print_stack_entry(self, frame_lineno: Tuple[FrameType, int], prompt_prefix: str = ...) -> None: ...
def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = ...) -> None: ...
def lookupmodule(self, filename: str) -> str | None: ...
def _runscript(self, filename: str) -> None: ...
def do_commands(self, arg: str) -> bool | None: ...
@@ -157,7 +157,7 @@ class Pdb(Bdb, Cmd):
# undocumented
def find_function(funcname: str, filename: str) -> Tuple[str, str, int] | None: ...
def find_function(funcname: str, filename: str) -> tuple[str, str, int] | None: ...
def main() -> None: ...
def help() -> None: ...