Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 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, Optional, Tuple, TypeVar, Union
from typing import IO, Any, Callable, ClassVar, Dict, Iterable, List, Mapping, Tuple, TypeVar
_T = TypeVar("_T")
@@ -9,12 +9,12 @@ line_prefix: str # undocumented
class Restart(Exception): ...
def run(statement: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ...
def runeval(expression: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ...
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) -> Optional[_T]: ...
def runcall(func: Callable[..., _T], *args: Any, **kwds: Any) -> _T | None: ...
def set_trace() -> None: ...
def post_mortem(t: Optional[TracebackType] = ...) -> None: ...
def post_mortem(t: TracebackType | None = ...) -> None: ...
def pm() -> None: ...
class Pdb(Bdb, Cmd):
@@ -30,64 +30,60 @@ class Pdb(Bdb, Cmd):
commands_doprompt: Dict[int, bool]
commands_silent: Dict[int, bool]
commands_defining: bool
commands_bnum: Optional[int]
lineno: Optional[int]
commands_bnum: int | None
lineno: int | None
stack: List[Tuple[FrameType, int]]
curindex: int
curframe: Optional[FrameType]
curframe: FrameType | None
curframe_locals: Mapping[str, Any]
def __init__(
self,
completekey: str = ...,
stdin: Optional[IO[str]] = ...,
stdout: Optional[IO[str]] = ...,
skip: Optional[Iterable[str]] = ...,
self, completekey: str = ..., stdin: IO[str] | None = ..., stdout: IO[str] | None = ..., skip: Iterable[str] | None = ...
) -> None: ...
def forget(self) -> None: ...
def setup(self, f: Optional[FrameType], tb: Optional[TracebackType]) -> None: ...
def setup(self, f: FrameType | None, tb: TracebackType | None) -> None: ...
def execRcLines(self) -> None: ...
def bp_commands(self, frame: FrameType) -> bool: ...
def interaction(self, frame: Optional[FrameType], traceback: Optional[TracebackType]) -> None: ...
def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ...
def displayhook(self, obj: object) -> None: ...
def handle_command_def(self, line: str) -> bool: ...
def defaultFile(self) -> str: ...
def lineinfo(self, identifier: str) -> Union[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 lookupmodule(self, filename: str) -> Optional[str]: ...
def lookupmodule(self, filename: str) -> str | None: ...
def _runscript(self, filename: str) -> None: ...
def do_commands(self, arg: str) -> Optional[bool]: ...
def do_break(self, arg: str, temporary: bool = ...) -> Optional[bool]: ...
def do_tbreak(self, arg: str) -> Optional[bool]: ...
def do_enable(self, arg: str) -> Optional[bool]: ...
def do_disable(self, arg: str) -> Optional[bool]: ...
def do_condition(self, arg: str) -> Optional[bool]: ...
def do_ignore(self, arg: str) -> Optional[bool]: ...
def do_clear(self, arg: str) -> Optional[bool]: ...
def do_where(self, arg: str) -> Optional[bool]: ...
def do_up(self, arg: str) -> Optional[bool]: ...
def do_down(self, arg: str) -> Optional[bool]: ...
def do_until(self, arg: str) -> Optional[bool]: ...
def do_step(self, arg: str) -> Optional[bool]: ...
def do_next(self, arg: str) -> Optional[bool]: ...
def do_run(self, arg: str) -> Optional[bool]: ...
def do_return(self, arg: str) -> Optional[bool]: ...
def do_continue(self, arg: str) -> Optional[bool]: ...
def do_jump(self, arg: str) -> Optional[bool]: ...
def do_debug(self, arg: str) -> Optional[bool]: ...
def do_quit(self, arg: str) -> Optional[bool]: ...
def do_EOF(self, arg: str) -> Optional[bool]: ...
def do_args(self, arg: str) -> Optional[bool]: ...
def do_retval(self, arg: str) -> Optional[bool]: ...
def do_p(self, arg: str) -> Optional[bool]: ...
def do_pp(self, arg: str) -> Optional[bool]: ...
def do_list(self, arg: str) -> Optional[bool]: ...
def do_whatis(self, arg: str) -> Optional[bool]: ...
def do_alias(self, arg: str) -> Optional[bool]: ...
def do_unalias(self, arg: str) -> Optional[bool]: ...
def do_help(self, arg: str) -> Optional[bool]: ...
def do_commands(self, arg: str) -> bool | None: ...
def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ...
def do_tbreak(self, arg: str) -> bool | None: ...
def do_enable(self, arg: str) -> bool | None: ...
def do_disable(self, arg: str) -> bool | None: ...
def do_condition(self, arg: str) -> bool | None: ...
def do_ignore(self, arg: str) -> bool | None: ...
def do_clear(self, arg: str) -> bool | None: ...
def do_where(self, arg: str) -> bool | None: ...
def do_up(self, arg: str) -> bool | None: ...
def do_down(self, arg: str) -> bool | None: ...
def do_until(self, arg: str) -> bool | None: ...
def do_step(self, arg: str) -> bool | None: ...
def do_next(self, arg: str) -> bool | None: ...
def do_run(self, arg: str) -> bool | None: ...
def do_return(self, arg: str) -> bool | None: ...
def do_continue(self, arg: str) -> bool | None: ...
def do_jump(self, arg: str) -> bool | None: ...
def do_debug(self, arg: str) -> bool | None: ...
def do_quit(self, arg: str) -> bool | None: ...
def do_EOF(self, arg: str) -> bool | None: ...
def do_args(self, arg: str) -> bool | None: ...
def do_retval(self, arg: str) -> bool | None: ...
def do_p(self, arg: str) -> bool | None: ...
def do_pp(self, arg: str) -> bool | None: ...
def do_list(self, arg: str) -> bool | None: ...
def do_whatis(self, arg: str) -> bool | None: ...
def do_alias(self, arg: str) -> bool | None: ...
def do_unalias(self, arg: str) -> bool | None: ...
def do_help(self, arg: str) -> bool | None: ...
do_b = do_break
do_cl = do_clear
do_w = do_where
@@ -161,7 +157,7 @@ class Pdb(Bdb, Cmd):
# undocumented
def find_function(funcname: str, filename: str) -> Optional[Tuple[str, str, int]]: ...
def find_function(funcname: str, filename: str) -> Tuple[str, str, int] | None: ...
def main() -> None: ...
def help() -> None: ...