Use PEP 570 syntax in stdlib (#11250)

This commit is contained in:
Shantanu
2024-03-09 14:50:16 -08:00
committed by GitHub
parent 63737acac6
commit 470a13ab09
139 changed files with 2412 additions and 2371 deletions

View File

@@ -275,15 +275,15 @@ if sys.platform != "win32":
def baudrate() -> int: ...
def beep() -> None: ...
def can_change_color() -> bool: ...
def cbreak(__flag: bool = True) -> None: ...
def color_content(__color_number: int) -> tuple[int, int, int]: ...
def color_pair(__pair_number: int) -> int: ...
def curs_set(__visibility: int) -> int: ...
def cbreak(flag: bool = True, /) -> None: ...
def color_content(color_number: int, /) -> tuple[int, int, int]: ...
def color_pair(pair_number: int, /) -> int: ...
def curs_set(visibility: int, /) -> int: ...
def def_prog_mode() -> None: ...
def def_shell_mode() -> None: ...
def delay_output(__ms: int) -> None: ...
def delay_output(ms: int, /) -> None: ...
def doupdate() -> None: ...
def echo(__flag: bool = True) -> None: ...
def echo(flag: bool = True, /) -> None: ...
def endwin() -> None: ...
def erasechar() -> bytes: ...
def filter() -> None: ...
@@ -295,82 +295,83 @@ if sys.platform != "win32":
def getmouse() -> tuple[int, int, int, int, int]: ...
def getsyx() -> tuple[int, int]: ...
def getwin(__file: SupportsRead[bytes]) -> _CursesWindow: ...
def halfdelay(__tenths: int) -> None: ...
def getwin(file: SupportsRead[bytes], /) -> _CursesWindow: ...
def halfdelay(tenths: int, /) -> None: ...
def has_colors() -> bool: ...
if sys.version_info >= (3, 10):
def has_extended_color_support() -> bool: ...
def has_ic() -> bool: ...
def has_il() -> bool: ...
def has_key(__key: int) -> bool: ...
def init_color(__color_number: int, __r: int, __g: int, __b: int) -> None: ...
def init_pair(__pair_number: int, __fg: int, __bg: int) -> None: ...
def has_key(key: int, /) -> bool: ...
def init_color(color_number: int, r: int, g: int, b: int, /) -> None: ...
def init_pair(pair_number: int, fg: int, bg: int, /) -> None: ...
def initscr() -> _CursesWindow: ...
def intrflush(__flag: bool) -> None: ...
def is_term_resized(__nlines: int, __ncols: int) -> bool: ...
def intrflush(flag: bool, /) -> None: ...
def is_term_resized(nlines: int, ncols: int, /) -> bool: ...
def isendwin() -> bool: ...
def keyname(__key: int) -> bytes: ...
def keyname(key: int, /) -> bytes: ...
def killchar() -> bytes: ...
def longname() -> bytes: ...
def meta(__yes: bool) -> None: ...
def mouseinterval(__interval: int) -> None: ...
def mousemask(__newmask: int) -> tuple[int, int]: ...
def napms(__ms: int) -> int: ...
def newpad(__nlines: int, __ncols: int) -> _CursesWindow: ...
def newwin(__nlines: int, __ncols: int, __begin_y: int = ..., __begin_x: int = ...) -> _CursesWindow: ...
def nl(__flag: bool = True) -> None: ...
def meta(yes: bool, /) -> None: ...
def mouseinterval(interval: int, /) -> None: ...
def mousemask(newmask: int, /) -> tuple[int, int]: ...
def napms(ms: int, /) -> int: ...
def newpad(nlines: int, ncols: int, /) -> _CursesWindow: ...
def newwin(nlines: int, ncols: int, begin_y: int = ..., begin_x: int = ..., /) -> _CursesWindow: ...
def nl(flag: bool = True, /) -> None: ...
def nocbreak() -> None: ...
def noecho() -> None: ...
def nonl() -> None: ...
def noqiflush() -> None: ...
def noraw() -> None: ...
def pair_content(__pair_number: int) -> tuple[int, int]: ...
def pair_number(__attr: int) -> int: ...
def putp(__string: ReadOnlyBuffer) -> None: ...
def qiflush(__flag: bool = True) -> None: ...
def raw(__flag: bool = True) -> None: ...
def pair_content(pair_number: int, /) -> tuple[int, int]: ...
def pair_number(attr: int, /) -> int: ...
def putp(string: ReadOnlyBuffer, /) -> None: ...
def qiflush(flag: bool = True, /) -> None: ...
def raw(flag: bool = True, /) -> None: ...
def reset_prog_mode() -> None: ...
def reset_shell_mode() -> None: ...
def resetty() -> None: ...
def resize_term(__nlines: int, __ncols: int) -> None: ...
def resizeterm(__nlines: int, __ncols: int) -> None: ...
def resize_term(nlines: int, ncols: int, /) -> None: ...
def resizeterm(nlines: int, ncols: int, /) -> None: ...
def savetty() -> None: ...
if sys.version_info >= (3, 9):
def set_escdelay(__ms: int) -> None: ...
def set_tabsize(__size: int) -> None: ...
def set_escdelay(ms: int, /) -> None: ...
def set_tabsize(size: int, /) -> None: ...
def setsyx(__y: int, __x: int) -> None: ...
def setsyx(y: int, x: int, /) -> None: ...
def setupterm(term: str | None = None, fd: int = -1) -> None: ...
def start_color() -> None: ...
def termattrs() -> int: ...
def termname() -> bytes: ...
def tigetflag(__capname: str) -> int: ...
def tigetnum(__capname: str) -> int: ...
def tigetstr(__capname: str) -> bytes | None: ...
def tigetflag(capname: str, /) -> int: ...
def tigetnum(capname: str, /) -> int: ...
def tigetstr(capname: str, /) -> bytes | None: ...
def tparm(
__str: ReadOnlyBuffer,
__i1: int = 0,
__i2: int = 0,
__i3: int = 0,
__i4: int = 0,
__i5: int = 0,
__i6: int = 0,
__i7: int = 0,
__i8: int = 0,
__i9: int = 0,
str: ReadOnlyBuffer,
i1: int = 0,
i2: int = 0,
i3: int = 0,
i4: int = 0,
i5: int = 0,
i6: int = 0,
i7: int = 0,
i8: int = 0,
i9: int = 0,
/,
) -> bytes: ...
def typeahead(__fd: int) -> None: ...
def unctrl(__ch: _ChType) -> bytes: ...
def typeahead(fd: int, /) -> None: ...
def unctrl(ch: _ChType, /) -> bytes: ...
if sys.version_info < (3, 12) or sys.platform != "darwin":
# The support for macos was dropped in 3.12
def unget_wch(__ch: int | str) -> None: ...
def unget_wch(ch: int | str, /) -> None: ...
def ungetch(__ch: _ChType) -> None: ...
def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ...
def ungetch(ch: _ChType, /) -> None: ...
def ungetmouse(id: int, x: int, y: int, z: int, bstate: int, /) -> None: ...
def update_lines_cols() -> None: ...
def use_default_colors() -> None: ...
def use_env(__flag: bool) -> None: ...
def use_env(flag: bool, /) -> None: ...
class error(Exception): ...
@@ -389,11 +390,11 @@ if sys.platform != "win32":
def addstr(self, str: str, attr: int = ...) -> None: ...
@overload
def addstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ...
def attroff(self, __attr: int) -> None: ...
def attron(self, __attr: int) -> None: ...
def attrset(self, __attr: int) -> None: ...
def bkgd(self, __ch: _ChType, __attr: int = ...) -> None: ...
def bkgdset(self, __ch: _ChType, __attr: int = ...) -> None: ...
def attroff(self, attr: int, /) -> None: ...
def attron(self, attr: int, /) -> None: ...
def attrset(self, attr: int, /) -> None: ...
def bkgd(self, ch: _ChType, attr: int = ..., /) -> None: ...
def bkgdset(self, ch: _ChType, attr: int = ..., /) -> None: ...
def border(
self,
ls: _ChType = ...,
@@ -431,8 +432,8 @@ if sys.platform != "win32":
def derwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ...
@overload
def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ...
def echochar(self, __ch: _ChType, __attr: int = ...) -> None: ...
def enclose(self, __y: int, __x: int) -> bool: ...
def echochar(self, ch: _ChType, attr: int = ..., /) -> None: ...
def enclose(self, y: int, x: int, /) -> bool: ...
def erase(self) -> None: ...
def getbegyx(self) -> tuple[int, int]: ...
def getbkgd(self) -> tuple[int, int]: ...
@@ -491,7 +492,7 @@ if sys.platform != "win32":
def instr(self, n: int = ...) -> bytes: ...
@overload
def instr(self, y: int, x: int, n: int = ...) -> bytes: ...
def is_linetouched(self, __line: int) -> bool: ...
def is_linetouched(self, line: int, /) -> bool: ...
def is_wintouched(self) -> bool: ...
def keypad(self, yes: bool) -> None: ...
def leaveok(self, yes: bool) -> None: ...
@@ -516,8 +517,8 @@ if sys.platform != "win32":
def overwrite(
self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int
) -> None: ...
def putwin(self, __file: IO[Any]) -> None: ...
def redrawln(self, __beg: int, __num: int) -> None: ...
def putwin(self, file: IO[Any], /) -> None: ...
def redrawln(self, beg: int, num: int, /) -> None: ...
def redrawwin(self) -> None: ...
@overload
def refresh(self) -> None: ...
@@ -526,7 +527,7 @@ if sys.platform != "win32":
def resize(self, nlines: int, ncols: int) -> None: ...
def scroll(self, lines: int = ...) -> None: ...
def scrollok(self, flag: bool) -> None: ...
def setscrreg(self, __top: int, __bottom: int) -> None: ...
def setscrreg(self, top: int, bottom: int, /) -> None: ...
def standend(self) -> None: ...
def standout(self) -> None: ...
@overload