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,11 +1,11 @@
from typing import IO, Any, Callable, List, Optional, Tuple
from typing import IO, Any, Callable, List, Tuple
class Cmd:
prompt: str
identchars: str
ruler: str
lastcmd: str
intro: Optional[Any]
intro: Any | None
doc_leader: str
doc_header: str
misc_header: str
@@ -16,24 +16,24 @@ class Cmd:
stdout: IO[str]
cmdqueue: List[str]
completekey: str
def __init__(self, completekey: str = ..., stdin: Optional[IO[str]] = ..., stdout: Optional[IO[str]] = ...) -> None: ...
old_completer: Optional[Callable[[str, int], Optional[str]]]
def cmdloop(self, intro: Optional[Any] = ...) -> None: ...
def __init__(self, completekey: str = ..., stdin: IO[str] | None = ..., stdout: IO[str] | None = ...) -> None: ...
old_completer: Callable[[str, int], str | None] | None
def cmdloop(self, intro: Any | None = ...) -> None: ...
def precmd(self, line: str) -> str: ...
def postcmd(self, stop: bool, line: str) -> bool: ...
def preloop(self) -> None: ...
def postloop(self) -> None: ...
def parseline(self, line: str) -> Tuple[Optional[str], Optional[str], str]: ...
def parseline(self, line: str) -> Tuple[str | None, str | None, str]: ...
def onecmd(self, line: str) -> bool: ...
def emptyline(self) -> bool: ...
def default(self, line: str) -> bool: ...
def completedefault(self, *ignored: Any) -> List[str]: ...
def completenames(self, text: str, *ignored: Any) -> List[str]: ...
completion_matches: Optional[List[str]]
def complete(self, text: str, state: int) -> Optional[List[str]]: ...
completion_matches: List[str] | None
def complete(self, text: str, state: int) -> List[str] | None: ...
def get_names(self) -> List[str]: ...
# Only the first element of args matters.
def complete_help(self, *args: Any) -> List[str]: ...
def do_help(self, arg: str) -> Optional[bool]: ...
def print_topics(self, header: str, cmds: Optional[List[str]], cmdlen: Any, maxcol: int) -> None: ...
def columnize(self, list: Optional[List[str]], displaywidth: int = ...) -> None: ...
def do_help(self, arg: str) -> bool | None: ...
def print_topics(self, header: str, cmds: List[str] | None, cmdlen: Any, maxcol: int) -> None: ...
def columnize(self, list: List[str] | None, displaywidth: int = ...) -> None: ...