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

@@ -13,13 +13,13 @@ _CharMap: TypeAlias = dict[int, int] | _EncodingMap
_Handler: TypeAlias = Callable[[UnicodeError], tuple[str | bytes, int]]
_SearchFunction: TypeAlias = Callable[[str], codecs.CodecInfo | None]
def register(__search_function: _SearchFunction) -> None: ...
def register(search_function: _SearchFunction, /) -> None: ...
if sys.version_info >= (3, 10):
def unregister(__search_function: _SearchFunction) -> None: ...
def unregister(search_function: _SearchFunction, /) -> None: ...
def register_error(__errors: str, __handler: _Handler) -> None: ...
def lookup_error(__name: str) -> _Handler: ...
def register_error(errors: str, handler: _Handler, /) -> None: ...
def lookup_error(name: str, /) -> _Handler: ...
# The type ignore on `encode` and `decode` is to avoid issues with overlapping overloads, for more details, see #300
# https://docs.python.org/3/library/codecs.html#binary-transforms
@@ -68,66 +68,66 @@ def decode(
def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = "strict") -> bytes: ...
@overload
def decode(obj: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> str: ...
def lookup(__encoding: str) -> codecs.CodecInfo: ...
def charmap_build(__map: str) -> _CharMap: ...
def ascii_decode(__data: ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ...
def ascii_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def charmap_decode(__data: ReadableBuffer, __errors: str | None = None, __mapping: _CharMap | None = None) -> tuple[str, int]: ...
def charmap_encode(__str: str, __errors: str | None = None, __mapping: _CharMap | None = None) -> tuple[bytes, int]: ...
def escape_decode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ...
def escape_encode(__data: bytes, __errors: str | None = None) -> tuple[bytes, int]: ...
def latin_1_decode(__data: ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ...
def latin_1_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def lookup(encoding: str, /) -> codecs.CodecInfo: ...
def charmap_build(map: str, /) -> _CharMap: ...
def ascii_decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ...
def ascii_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def charmap_decode(data: ReadableBuffer, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[str, int]: ...
def charmap_encode(str: str, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[bytes, int]: ...
def escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ...
def escape_encode(data: bytes, errors: str | None = None, /) -> tuple[bytes, int]: ...
def latin_1_decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ...
def latin_1_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
if sys.version_info >= (3, 9):
def raw_unicode_escape_decode(
__data: str | ReadableBuffer, __errors: str | None = None, __final: bool = True
data: str | ReadableBuffer, errors: str | None = None, final: bool = True, /
) -> tuple[str, int]: ...
else:
def raw_unicode_escape_decode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ...
def raw_unicode_escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ...
def raw_unicode_escape_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def readbuffer_encode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[bytes, int]: ...
def raw_unicode_escape_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def readbuffer_encode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[bytes, int]: ...
if sys.version_info >= (3, 9):
def unicode_escape_decode(
__data: str | ReadableBuffer, __errors: str | None = None, __final: bool = True
data: str | ReadableBuffer, errors: str | None = None, final: bool = True, /
) -> tuple[str, int]: ...
else:
def unicode_escape_decode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ...
def unicode_escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ...
def unicode_escape_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def utf_16_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_16_be_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def utf_16_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_16_encode(__str: str, __errors: str | None = None, __byteorder: int = 0) -> tuple[bytes, int]: ...
def unicode_escape_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_16_be_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_16_be_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_16_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_16_encode(str: str, errors: str | None = None, byteorder: int = 0, /) -> tuple[bytes, int]: ...
def utf_16_ex_decode(
__data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: bool = False
data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False, /
) -> tuple[str, int, int]: ...
def utf_16_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_16_le_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def utf_32_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_32_be_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def utf_32_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_32_encode(__str: str, __errors: str | None = None, __byteorder: int = 0) -> tuple[bytes, int]: ...
def utf_16_le_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_16_le_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_32_be_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_32_be_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_32_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_32_encode(str: str, errors: str | None = None, byteorder: int = 0, /) -> tuple[bytes, int]: ...
def utf_32_ex_decode(
__data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: bool = False
data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False, /
) -> tuple[str, int, int]: ...
def utf_32_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_32_le_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def utf_7_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_7_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def utf_8_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def utf_8_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def utf_32_le_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_32_le_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_7_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_7_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_8_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_8_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
if sys.platform == "win32":
def mbcs_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def mbcs_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def mbcs_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def mbcs_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def code_page_decode(
__codepage: int, __data: ReadableBuffer, __errors: str | None = None, __final: bool = False
codepage: int, data: ReadableBuffer, errors: str | None = None, final: bool = False, /
) -> tuple[str, int]: ...
def code_page_encode(__code_page: int, __str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def oem_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def oem_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def code_page_encode(code_page: int, str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def oem_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def oem_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...

View File

@@ -69,7 +69,7 @@ _VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
@final
class dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]): # undocumented
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
if sys.version_info >= (3, 10):
@property
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
@@ -82,7 +82,7 @@ class dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]): # undocumented
@final
class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
if sys.version_info >= (3, 10):
@property
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
@@ -91,4 +91,4 @@ if sys.version_info >= (3, 12):
@runtime_checkable
class Buffer(Protocol):
@abstractmethod
def __buffer__(self, __flags: int) -> memoryview: ...
def __buffer__(self, flags: int, /) -> memoryview: ...

View File

@@ -6,9 +6,9 @@ from typing import Any, Protocol
BUFFER_SIZE = DEFAULT_BUFFER_SIZE
class _Reader(Protocol):
def read(self, __n: int) -> bytes: ...
def read(self, n: int, /) -> bytes: ...
def seekable(self) -> bool: ...
def seek(self, __n: int) -> Any: ...
def seek(self, n: int, /) -> Any: ...
class BaseStream(BufferedIOBase): ...

View File

@@ -44,8 +44,8 @@ if sys.platform == "win32":
def FormatError(code: int = ...) -> str: ...
def get_last_error() -> int: ...
def set_last_error(value: int) -> int: ...
def LoadLibrary(__name: str, __load_flags: int = 0) -> int: ...
def FreeLibrary(__handle: int) -> None: ...
def LoadLibrary(name: str, load_flags: int = 0, /) -> int: ...
def FreeLibrary(handle: int, /) -> None: ...
class _CDataMeta(type):
# By default mypy complains about the following two methods, because strictly speaking cls
@@ -75,8 +75,8 @@ class _CData(metaclass=_CDataMeta):
def from_param(cls, obj: Any) -> Self | _CArgObject: ...
@classmethod
def in_dll(cls, library: CDLL, name: str) -> Self: ...
def __buffer__(self, __flags: int) -> memoryview: ...
def __release_buffer__(self, __buffer: memoryview) -> None: ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
class _SimpleCData(_CData, Generic[_T]):
value: _T
@@ -95,13 +95,13 @@ class _Pointer(_PointerLike, _CData, Generic[_CT]):
@overload
def __init__(self, arg: _CT) -> None: ...
@overload
def __getitem__(self, __key: int) -> Any: ...
def __getitem__(self, key: int, /) -> Any: ...
@overload
def __getitem__(self, __key: slice) -> list[Any]: ...
def __setitem__(self, __key: int, __value: Any) -> None: ...
def __getitem__(self, key: slice, /) -> list[Any]: ...
def __setitem__(self, key: int, value: Any, /) -> None: ...
def POINTER(type: type[_CT]) -> type[_Pointer[_CT]]: ...
def pointer(__arg: _CT) -> _Pointer[_CT]: ...
def pointer(arg: _CT, /) -> _Pointer[_CT]: ...
class _CArgObject: ...
@@ -119,15 +119,15 @@ class CFuncPtr(_PointerLike, _CData):
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, __address: int) -> None: ...
def __init__(self, address: int, /) -> None: ...
@overload
def __init__(self, __callable: Callable[..., Any]) -> None: ...
def __init__(self, callable: Callable[..., Any], /) -> None: ...
@overload
def __init__(self, __func_spec: tuple[str | int, CDLL], __paramflags: tuple[_PF, ...] | None = ...) -> None: ...
def __init__(self, func_spec: tuple[str | int, CDLL], paramflags: tuple[_PF, ...] | None = ..., /) -> None: ...
if sys.platform == "win32":
@overload
def __init__(
self, __vtbl_index: int, __name: str, __paramflags: tuple[_PF, ...] | None = ..., __iid: _CData | None = ...
self, vtbl_index: int, name: str, paramflags: tuple[_PF, ...] | None = ..., iid: _CData | None = ..., /
) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
@@ -139,10 +139,10 @@ class _CField(Generic[_CT, _GetT, _SetT]):
offset: int
size: int
@overload
def __get__(self, __instance: None, __owner: type[Any] | None) -> Self: ...
def __get__(self, instance: None, owner: type[Any] | None, /) -> Self: ...
@overload
def __get__(self, __instance: Any, __owner: type[Any] | None) -> _GetT: ...
def __set__(self, __instance: Any, __value: _SetT) -> None: ...
def __get__(self, instance: Any, owner: type[Any] | None, /) -> _GetT: ...
def __set__(self, instance: Any, value: _SetT, /) -> None: ...
class _StructUnionMeta(_CDataMeta):
_fields_: Sequence[tuple[str, type[_CData]] | tuple[str, type[_CData], int]]
@@ -189,13 +189,13 @@ class Array(_CData, Generic[_CT]):
# the array element type would belong are annotated with Any instead.
def __init__(self, *args: Any) -> None: ...
@overload
def __getitem__(self, __key: int) -> Any: ...
def __getitem__(self, key: int, /) -> Any: ...
@overload
def __getitem__(self, __key: slice) -> list[Any]: ...
def __getitem__(self, key: slice, /) -> list[Any]: ...
@overload
def __setitem__(self, __key: int, __value: Any) -> None: ...
def __setitem__(self, key: int, value: Any, /) -> None: ...
@overload
def __setitem__(self, __key: slice, __value: Iterable[Any]) -> None: ...
def __setitem__(self, key: slice, value: Iterable[Any], /) -> None: ...
def __iter__(self) -> Iterator[Any]: ...
# Can't inherit from Sized because the metaclass conflict between
# Sized and _CData prevents using _CDataMeta.

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

View File

@@ -47,7 +47,7 @@ class Overflow(Inexact, Rounded): ...
class Underflow(Inexact, Rounded, Subnormal): ...
class FloatOperation(DecimalException, TypeError): ...
def setcontext(__context: Context) -> None: ...
def setcontext(context: Context, /) -> None: ...
def getcontext() -> Context: ...
if sys.version_info >= (3, 11):
@@ -70,7 +70,7 @@ else:
class Decimal:
def __new__(cls, value: _DecimalNew = ..., context: Context | None = ...) -> Self: ...
@classmethod
def from_float(cls, __f: float) -> Self: ...
def from_float(cls, f: float, /) -> Self: ...
def __bool__(self) -> bool: ...
def compare(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def __hash__(self) -> int: ...
@@ -78,28 +78,28 @@ class Decimal:
def as_integer_ratio(self) -> tuple[int, int]: ...
def to_eng_string(self, context: Context | None = None) -> str: ...
def __abs__(self) -> Decimal: ...
def __add__(self, __value: _Decimal) -> Decimal: ...
def __divmod__(self, __value: _Decimal) -> tuple[Decimal, Decimal]: ...
def __eq__(self, __value: object) -> bool: ...
def __floordiv__(self, __value: _Decimal) -> Decimal: ...
def __ge__(self, __value: _ComparableNum) -> bool: ...
def __gt__(self, __value: _ComparableNum) -> bool: ...
def __le__(self, __value: _ComparableNum) -> bool: ...
def __lt__(self, __value: _ComparableNum) -> bool: ...
def __mod__(self, __value: _Decimal) -> Decimal: ...
def __mul__(self, __value: _Decimal) -> Decimal: ...
def __add__(self, value: _Decimal, /) -> Decimal: ...
def __divmod__(self, value: _Decimal, /) -> tuple[Decimal, Decimal]: ...
def __eq__(self, value: object, /) -> bool: ...
def __floordiv__(self, value: _Decimal, /) -> Decimal: ...
def __ge__(self, value: _ComparableNum, /) -> bool: ...
def __gt__(self, value: _ComparableNum, /) -> bool: ...
def __le__(self, value: _ComparableNum, /) -> bool: ...
def __lt__(self, value: _ComparableNum, /) -> bool: ...
def __mod__(self, value: _Decimal, /) -> Decimal: ...
def __mul__(self, value: _Decimal, /) -> Decimal: ...
def __neg__(self) -> Decimal: ...
def __pos__(self) -> Decimal: ...
def __pow__(self, __value: _Decimal, __mod: _Decimal | None = None) -> Decimal: ...
def __radd__(self, __value: _Decimal) -> Decimal: ...
def __rdivmod__(self, __value: _Decimal) -> tuple[Decimal, Decimal]: ...
def __rfloordiv__(self, __value: _Decimal) -> Decimal: ...
def __rmod__(self, __value: _Decimal) -> Decimal: ...
def __rmul__(self, __value: _Decimal) -> Decimal: ...
def __rsub__(self, __value: _Decimal) -> Decimal: ...
def __rtruediv__(self, __value: _Decimal) -> Decimal: ...
def __sub__(self, __value: _Decimal) -> Decimal: ...
def __truediv__(self, __value: _Decimal) -> Decimal: ...
def __pow__(self, value: _Decimal, mod: _Decimal | None = None, /) -> Decimal: ...
def __radd__(self, value: _Decimal, /) -> Decimal: ...
def __rdivmod__(self, value: _Decimal, /) -> tuple[Decimal, Decimal]: ...
def __rfloordiv__(self, value: _Decimal, /) -> Decimal: ...
def __rmod__(self, value: _Decimal, /) -> Decimal: ...
def __rmul__(self, value: _Decimal, /) -> Decimal: ...
def __rsub__(self, value: _Decimal, /) -> Decimal: ...
def __rtruediv__(self, value: _Decimal, /) -> Decimal: ...
def __sub__(self, value: _Decimal, /) -> Decimal: ...
def __truediv__(self, value: _Decimal, /) -> Decimal: ...
def remainder_near(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def __float__(self) -> float: ...
def __int__(self) -> int: ...
@@ -113,11 +113,11 @@ class Decimal:
@overload
def __round__(self) -> int: ...
@overload
def __round__(self, __ndigits: int) -> Decimal: ...
def __round__(self, ndigits: int, /) -> Decimal: ...
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
def fma(self, other: _Decimal, third: _Decimal, context: Context | None = None) -> Decimal: ...
def __rpow__(self, __value: _Decimal, __mod: Context | None = None) -> Decimal: ...
def __rpow__(self, value: _Decimal, mod: Context | None = None, /) -> Decimal: ...
def normalize(self, context: Context | None = None) -> Decimal: ...
def quantize(self, exp: _Decimal, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
def same_quantum(self, other: _Decimal, context: Context | None = None) -> bool: ...
@@ -165,8 +165,8 @@ class Decimal:
def shift(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def __reduce__(self) -> tuple[type[Self], tuple[str]]: ...
def __copy__(self) -> Self: ...
def __deepcopy__(self, __memo: Any) -> Self: ...
def __format__(self, __specifier: str, __context: Context | None = ...) -> str: ...
def __deepcopy__(self, memo: Any, /) -> Self: ...
def __format__(self, specifier: str, context: Context | None = ..., /) -> str: ...
class _ContextManager:
new_context: Context
@@ -212,69 +212,69 @@ class Context:
__hash__: ClassVar[None] # type: ignore[assignment]
def Etiny(self) -> int: ...
def Etop(self) -> int: ...
def create_decimal(self, __num: _DecimalNew = "0") -> Decimal: ...
def create_decimal_from_float(self, __f: float) -> Decimal: ...
def abs(self, __x: _Decimal) -> Decimal: ...
def add(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def canonical(self, __x: Decimal) -> Decimal: ...
def compare(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def compare_signal(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def compare_total(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def compare_total_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def copy_abs(self, __x: _Decimal) -> Decimal: ...
def copy_decimal(self, __x: _Decimal) -> Decimal: ...
def copy_negate(self, __x: _Decimal) -> Decimal: ...
def copy_sign(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divide(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divide_int(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divmod(self, __x: _Decimal, __y: _Decimal) -> tuple[Decimal, Decimal]: ...
def exp(self, __x: _Decimal) -> Decimal: ...
def fma(self, __x: _Decimal, __y: _Decimal, __z: _Decimal) -> Decimal: ...
def is_canonical(self, __x: _Decimal) -> bool: ...
def is_finite(self, __x: _Decimal) -> bool: ...
def is_infinite(self, __x: _Decimal) -> bool: ...
def is_nan(self, __x: _Decimal) -> bool: ...
def is_normal(self, __x: _Decimal) -> bool: ...
def is_qnan(self, __x: _Decimal) -> bool: ...
def is_signed(self, __x: _Decimal) -> bool: ...
def is_snan(self, __x: _Decimal) -> bool: ...
def is_subnormal(self, __x: _Decimal) -> bool: ...
def is_zero(self, __x: _Decimal) -> bool: ...
def ln(self, __x: _Decimal) -> Decimal: ...
def log10(self, __x: _Decimal) -> Decimal: ...
def logb(self, __x: _Decimal) -> Decimal: ...
def logical_and(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def logical_invert(self, __x: _Decimal) -> Decimal: ...
def logical_or(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def logical_xor(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def max(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def max_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def min(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def min_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def minus(self, __x: _Decimal) -> Decimal: ...
def multiply(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def next_minus(self, __x: _Decimal) -> Decimal: ...
def next_plus(self, __x: _Decimal) -> Decimal: ...
def next_toward(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def normalize(self, __x: _Decimal) -> Decimal: ...
def number_class(self, __x: _Decimal) -> str: ...
def plus(self, __x: _Decimal) -> Decimal: ...
def create_decimal(self, num: _DecimalNew = "0", /) -> Decimal: ...
def create_decimal_from_float(self, f: float, /) -> Decimal: ...
def abs(self, x: _Decimal, /) -> Decimal: ...
def add(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def canonical(self, x: Decimal, /) -> Decimal: ...
def compare(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def compare_signal(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def compare_total(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def compare_total_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def copy_abs(self, x: _Decimal, /) -> Decimal: ...
def copy_decimal(self, x: _Decimal, /) -> Decimal: ...
def copy_negate(self, x: _Decimal, /) -> Decimal: ...
def copy_sign(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def divide(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def divide_int(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def divmod(self, x: _Decimal, y: _Decimal, /) -> tuple[Decimal, Decimal]: ...
def exp(self, x: _Decimal, /) -> Decimal: ...
def fma(self, x: _Decimal, y: _Decimal, z: _Decimal, /) -> Decimal: ...
def is_canonical(self, x: _Decimal, /) -> bool: ...
def is_finite(self, x: _Decimal, /) -> bool: ...
def is_infinite(self, x: _Decimal, /) -> bool: ...
def is_nan(self, x: _Decimal, /) -> bool: ...
def is_normal(self, x: _Decimal, /) -> bool: ...
def is_qnan(self, x: _Decimal, /) -> bool: ...
def is_signed(self, x: _Decimal, /) -> bool: ...
def is_snan(self, x: _Decimal, /) -> bool: ...
def is_subnormal(self, x: _Decimal, /) -> bool: ...
def is_zero(self, x: _Decimal, /) -> bool: ...
def ln(self, x: _Decimal, /) -> Decimal: ...
def log10(self, x: _Decimal, /) -> Decimal: ...
def logb(self, x: _Decimal, /) -> Decimal: ...
def logical_and(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def logical_invert(self, x: _Decimal, /) -> Decimal: ...
def logical_or(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def logical_xor(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def max(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def max_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def min(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def min_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def minus(self, x: _Decimal, /) -> Decimal: ...
def multiply(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def next_minus(self, x: _Decimal, /) -> Decimal: ...
def next_plus(self, x: _Decimal, /) -> Decimal: ...
def next_toward(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def normalize(self, x: _Decimal, /) -> Decimal: ...
def number_class(self, x: _Decimal, /) -> str: ...
def plus(self, x: _Decimal, /) -> Decimal: ...
def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = None) -> Decimal: ...
def quantize(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def quantize(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def radix(self) -> Decimal: ...
def remainder(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def remainder_near(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def rotate(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def same_quantum(self, __x: _Decimal, __y: _Decimal) -> bool: ...
def scaleb(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def shift(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def sqrt(self, __x: _Decimal) -> Decimal: ...
def subtract(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def to_eng_string(self, __x: _Decimal) -> str: ...
def to_sci_string(self, __x: _Decimal) -> str: ...
def to_integral_exact(self, __x: _Decimal) -> Decimal: ...
def to_integral_value(self, __x: _Decimal) -> Decimal: ...
def to_integral(self, __x: _Decimal) -> Decimal: ...
def remainder(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def remainder_near(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def rotate(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def same_quantum(self, x: _Decimal, y: _Decimal, /) -> bool: ...
def scaleb(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def shift(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def sqrt(self, x: _Decimal, /) -> Decimal: ...
def subtract(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
def to_eng_string(self, x: _Decimal, /) -> str: ...
def to_sci_string(self, x: _Decimal, /) -> str: ...
def to_integral_exact(self, x: _Decimal, /) -> Decimal: ...
def to_integral_value(self, x: _Decimal, /) -> Decimal: ...
def to_integral(self, x: _Decimal, /) -> Decimal: ...
DefaultContext: Context
BasicContext: Context

View File

@@ -4,8 +4,8 @@ _T = TypeVar("_T")
__about__: Final[str]
def heapify(__heap: list[Any]) -> None: ...
def heappop(__heap: list[_T]) -> _T: ...
def heappush(__heap: list[_T], __item: _T) -> None: ...
def heappushpop(__heap: list[_T], __item: _T) -> _T: ...
def heapreplace(__heap: list[_T], __item: _T) -> _T: ...
def heapify(heap: list[Any], /) -> None: ...
def heappop(heap: list[_T], /) -> _T: ...
def heappush(heap: list[_T], item: _T, /) -> None: ...
def heappushpop(heap: list[_T], item: _T, /) -> _T: ...
def heapreplace(heap: list[_T], item: _T, /) -> _T: ...

View File

@@ -7,22 +7,22 @@ from typing import Any
check_hash_based_pycs: str
def source_hash(key: int, source: ReadableBuffer) -> bytes: ...
def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ...
def create_dynamic(__spec: ModuleSpec, __file: Any = None) -> types.ModuleType: ...
def create_builtin(spec: ModuleSpec, /) -> types.ModuleType: ...
def create_dynamic(spec: ModuleSpec, file: Any = None, /) -> types.ModuleType: ...
def acquire_lock() -> None: ...
def exec_builtin(__mod: types.ModuleType) -> int: ...
def exec_dynamic(__mod: types.ModuleType) -> int: ...
def exec_builtin(mod: types.ModuleType, /) -> int: ...
def exec_dynamic(mod: types.ModuleType, /) -> int: ...
def extension_suffixes() -> list[str]: ...
def init_frozen(__name: str) -> types.ModuleType: ...
def is_builtin(__name: str) -> int: ...
def is_frozen(__name: str) -> bool: ...
def is_frozen_package(__name: str) -> bool: ...
def init_frozen(name: str, /) -> types.ModuleType: ...
def is_builtin(name: str, /) -> int: ...
def is_frozen(name: str, /) -> bool: ...
def is_frozen_package(name: str, /) -> bool: ...
def lock_held() -> bool: ...
def release_lock() -> None: ...
if sys.version_info >= (3, 11):
def find_frozen(__name: str, *, withdata: bool = False) -> tuple[memoryview | None, bool, str | None] | None: ...
def get_frozen_object(__name: str, __data: ReadableBuffer | None = None) -> types.CodeType: ...
def find_frozen(name: str, /, *, withdata: bool = False) -> tuple[memoryview | None, bool, str | None] | None: ...
def get_frozen_object(name: str, data: ReadableBuffer | None = None, /) -> types.CodeType: ...
else:
def get_frozen_object(__name: str) -> types.CodeType: ...
def get_frozen_object(name: str, /) -> types.CodeType: ...

View File

@@ -10,14 +10,14 @@ LC_NUMERIC: int
LC_ALL: int
CHAR_MAX: int
def setlocale(__category: int, __locale: str | None = None) -> str: ...
def setlocale(category: int, locale: str | None = None, /) -> str: ...
def localeconv() -> Mapping[str, int | str | list[int]]: ...
if sys.version_info >= (3, 11):
def getencoding() -> str: ...
def strcoll(__os1: str, __os2: str) -> int: ...
def strxfrm(__string: str) -> str: ...
def strcoll(os1: str, os2: str, /) -> int: ...
def strxfrm(string: str, /) -> str: ...
# native gettext functions
# https://docs.python.org/3/library/locale.html#access-to-message-catalogs
@@ -87,14 +87,14 @@ if sys.platform != "win32":
CRNCYSTR: int
ALT_DIGITS: int
def nl_langinfo(__key: int) -> str: ...
def nl_langinfo(key: int, /) -> str: ...
# This is dependent on `libintl.h` which is a part of `gettext`
# system dependency. These functions might be missing.
# But, we always say that they are present.
def gettext(__msg: str) -> str: ...
def dgettext(__domain: str | None, __msg: str) -> str: ...
def dcgettext(__domain: str | None, __msg: str, __category: int) -> str: ...
def textdomain(__domain: str | None) -> str: ...
def bindtextdomain(__domain: str, __dir: StrPath | None) -> str: ...
def bind_textdomain_codeset(__domain: str, __codeset: str | None) -> str | None: ...
def gettext(msg: str, /) -> str: ...
def dgettext(domain: str | None, msg: str, /) -> str: ...
def dcgettext(domain: str | None, msg: str, category: int, /) -> str: ...
def textdomain(domain: str | None, /) -> str: ...
def bindtextdomain(domain: str, dir: StrPath | None, /) -> str: ...
def bind_textdomain_codeset(domain: str, codeset: str | None, /) -> str | None: ...

View File

@@ -47,9 +47,9 @@ if sys.platform == "win32":
__init__: None # type: ignore[assignment]
def UuidCreate() -> str: ...
def FCICreate(__cabname: str, __files: list[str]) -> None: ...
def OpenDatabase(__path: str, __persist: int) -> _Database: ...
def CreateRecord(__count: int) -> _Record: ...
def FCICreate(cabname: str, files: list[str], /) -> None: ...
def OpenDatabase(path: str, persist: int, /) -> _Database: ...
def CreateRecord(count: int, /) -> _Record: ...
MSICOLINFO_NAMES: int
MSICOLINFO_TYPES: int

View File

@@ -19,16 +19,16 @@ _Ts = TypeVarTuple("_Ts")
# the numpy.array comparison dunders return another numpy.array.
class _SupportsDunderLT(Protocol):
def __lt__(self, __other: Any) -> Any: ...
def __lt__(self, other: Any, /) -> Any: ...
class _SupportsDunderGT(Protocol):
def __gt__(self, __other: Any) -> Any: ...
def __gt__(self, other: Any, /) -> Any: ...
class _SupportsDunderLE(Protocol):
def __le__(self, __other: Any) -> Any: ...
def __le__(self, other: Any, /) -> Any: ...
class _SupportsDunderGE(Protocol):
def __ge__(self, __other: Any) -> Any: ...
def __ge__(self, other: Any, /) -> Any: ...
_SupportsComparison: TypeAlias = _SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT
@@ -42,56 +42,56 @@ class _SupportsPos(Protocol[_T_co]):
def __pos__(self) -> _T_co: ...
# All four comparison functions must have the same signature, or we get false-positive errors
def lt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def le(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def eq(__a: object, __b: object) -> Any: ...
def ne(__a: object, __b: object) -> Any: ...
def ge(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def gt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def not_(__a: object) -> bool: ...
def truth(__a: object) -> bool: ...
def is_(__a: object, __b: object) -> bool: ...
def is_not(__a: object, __b: object) -> bool: ...
def abs(__a: SupportsAbs[_T]) -> _T: ...
def add(__a: Any, __b: Any) -> Any: ...
def and_(__a: Any, __b: Any) -> Any: ...
def floordiv(__a: Any, __b: Any) -> Any: ...
def index(__a: SupportsIndex) -> int: ...
def inv(__a: _SupportsInversion[_T_co]) -> _T_co: ...
def invert(__a: _SupportsInversion[_T_co]) -> _T_co: ...
def lshift(__a: Any, __b: Any) -> Any: ...
def mod(__a: Any, __b: Any) -> Any: ...
def mul(__a: Any, __b: Any) -> Any: ...
def matmul(__a: Any, __b: Any) -> Any: ...
def neg(__a: _SupportsNeg[_T_co]) -> _T_co: ...
def or_(__a: Any, __b: Any) -> Any: ...
def pos(__a: _SupportsPos[_T_co]) -> _T_co: ...
def pow(__a: Any, __b: Any) -> Any: ...
def rshift(__a: Any, __b: Any) -> Any: ...
def sub(__a: Any, __b: Any) -> Any: ...
def truediv(__a: Any, __b: Any) -> Any: ...
def xor(__a: Any, __b: Any) -> Any: ...
def concat(__a: Sequence[_T], __b: Sequence[_T]) -> Sequence[_T]: ...
def contains(__a: Container[object], __b: object) -> bool: ...
def countOf(__a: Iterable[object], __b: object) -> int: ...
def lt(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ...
def le(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ...
def eq(a: object, b: object, /) -> Any: ...
def ne(a: object, b: object, /) -> Any: ...
def ge(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ...
def gt(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ...
def not_(a: object, /) -> bool: ...
def truth(a: object, /) -> bool: ...
def is_(a: object, b: object, /) -> bool: ...
def is_not(a: object, b: object, /) -> bool: ...
def abs(a: SupportsAbs[_T], /) -> _T: ...
def add(a: Any, b: Any, /) -> Any: ...
def and_(a: Any, b: Any, /) -> Any: ...
def floordiv(a: Any, b: Any, /) -> Any: ...
def index(a: SupportsIndex, /) -> int: ...
def inv(a: _SupportsInversion[_T_co], /) -> _T_co: ...
def invert(a: _SupportsInversion[_T_co], /) -> _T_co: ...
def lshift(a: Any, b: Any, /) -> Any: ...
def mod(a: Any, b: Any, /) -> Any: ...
def mul(a: Any, b: Any, /) -> Any: ...
def matmul(a: Any, b: Any, /) -> Any: ...
def neg(a: _SupportsNeg[_T_co], /) -> _T_co: ...
def or_(a: Any, b: Any, /) -> Any: ...
def pos(a: _SupportsPos[_T_co], /) -> _T_co: ...
def pow(a: Any, b: Any, /) -> Any: ...
def rshift(a: Any, b: Any, /) -> Any: ...
def sub(a: Any, b: Any, /) -> Any: ...
def truediv(a: Any, b: Any, /) -> Any: ...
def xor(a: Any, b: Any, /) -> Any: ...
def concat(a: Sequence[_T], b: Sequence[_T], /) -> Sequence[_T]: ...
def contains(a: Container[object], b: object, /) -> bool: ...
def countOf(a: Iterable[object], b: object, /) -> int: ...
@overload
def delitem(__a: MutableSequence[Any], __b: SupportsIndex) -> None: ...
def delitem(a: MutableSequence[Any], b: SupportsIndex, /) -> None: ...
@overload
def delitem(__a: MutableSequence[Any], __b: slice) -> None: ...
def delitem(a: MutableSequence[Any], b: slice, /) -> None: ...
@overload
def delitem(__a: MutableMapping[_K, Any], __b: _K) -> None: ...
def delitem(a: MutableMapping[_K, Any], b: _K, /) -> None: ...
@overload
def getitem(__a: Sequence[_T], __b: slice) -> Sequence[_T]: ...
def getitem(a: Sequence[_T], b: slice, /) -> Sequence[_T]: ...
@overload
def getitem(__a: SupportsGetItem[_K, _V], __b: _K) -> _V: ...
def indexOf(__a: Iterable[_T], __b: _T) -> int: ...
def getitem(a: SupportsGetItem[_K, _V], b: _K, /) -> _V: ...
def indexOf(a: Iterable[_T], b: _T, /) -> int: ...
@overload
def setitem(__a: MutableSequence[_T], __b: SupportsIndex, __c: _T) -> None: ...
def setitem(a: MutableSequence[_T], b: SupportsIndex, c: _T, /) -> None: ...
@overload
def setitem(__a: MutableSequence[_T], __b: slice, __c: Sequence[_T]) -> None: ...
def setitem(a: MutableSequence[_T], b: slice, c: Sequence[_T], /) -> None: ...
@overload
def setitem(__a: MutableMapping[_K, _V], __b: _K, __c: _V) -> None: ...
def length_hint(__obj: object, __default: int = 0) -> int: ...
def setitem(a: MutableMapping[_K, _V], b: _K, c: _V, /) -> None: ...
def length_hint(obj: object, default: int = 0, /) -> int: ...
@final
class attrgetter(Generic[_T_co]):
@overload
@@ -109,9 +109,9 @@ class attrgetter(Generic[_T_co]):
@final
class itemgetter(Generic[_T_co]):
@overload
def __new__(cls, __item: _T) -> itemgetter[_T]: ...
def __new__(cls, item: _T, /) -> itemgetter[_T]: ...
@overload
def __new__(cls, __item1: _T1, __item2: _T2, *items: Unpack[_Ts]) -> itemgetter[tuple[_T1, _T2, Unpack[_Ts]]]: ...
def __new__(cls, item1: _T1, item2: _T2, /, *items: Unpack[_Ts]) -> itemgetter[tuple[_T1, _T2, Unpack[_Ts]]]: ...
# __key: _KT_contra in SupportsGetItem seems to be causing variance issues, ie:
# TypeVar "_KT_contra@SupportsGetItem" is contravariant
# "tuple[int, int]" is incompatible with protocol "SupportsIndex"
@@ -123,25 +123,25 @@ class itemgetter(Generic[_T_co]):
@final
class methodcaller:
def __init__(self, __name: str, *args: Any, **kwargs: Any) -> None: ...
def __init__(self, name: str, /, *args: Any, **kwargs: Any) -> None: ...
def __call__(self, obj: Any) -> Any: ...
def iadd(__a: Any, __b: Any) -> Any: ...
def iand(__a: Any, __b: Any) -> Any: ...
def iconcat(__a: Any, __b: Any) -> Any: ...
def ifloordiv(__a: Any, __b: Any) -> Any: ...
def ilshift(__a: Any, __b: Any) -> Any: ...
def imod(__a: Any, __b: Any) -> Any: ...
def imul(__a: Any, __b: Any) -> Any: ...
def imatmul(__a: Any, __b: Any) -> Any: ...
def ior(__a: Any, __b: Any) -> Any: ...
def ipow(__a: Any, __b: Any) -> Any: ...
def irshift(__a: Any, __b: Any) -> Any: ...
def isub(__a: Any, __b: Any) -> Any: ...
def itruediv(__a: Any, __b: Any) -> Any: ...
def ixor(__a: Any, __b: Any) -> Any: ...
def iadd(a: Any, b: Any, /) -> Any: ...
def iand(a: Any, b: Any, /) -> Any: ...
def iconcat(a: Any, b: Any, /) -> Any: ...
def ifloordiv(a: Any, b: Any, /) -> Any: ...
def ilshift(a: Any, b: Any, /) -> Any: ...
def imod(a: Any, b: Any, /) -> Any: ...
def imul(a: Any, b: Any, /) -> Any: ...
def imatmul(a: Any, b: Any, /) -> Any: ...
def ior(a: Any, b: Any, /) -> Any: ...
def ipow(a: Any, b: Any, /) -> Any: ...
def irshift(a: Any, b: Any, /) -> Any: ...
def isub(a: Any, b: Any, /) -> Any: ...
def itruediv(a: Any, b: Any, /) -> Any: ...
def ixor(a: Any, b: Any, /) -> Any: ...
if sys.version_info >= (3, 11):
def call(__obj: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ...
def call(obj: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R: ...
def _compare_digest(__a: AnyStr, __b: AnyStr) -> bool: ...
def _compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ...

View File

@@ -6,27 +6,28 @@ from typing import SupportsIndex
if sys.platform != "win32":
def cloexec_pipe() -> tuple[int, int]: ...
def fork_exec(
__args: Sequence[StrOrBytesPath] | None,
__executable_list: Sequence[bytes],
__close_fds: bool,
__pass_fds: tuple[int, ...],
__cwd: str,
__env: Sequence[bytes] | None,
__p2cread: int,
__p2cwrite: int,
__c2pread: int,
__c2pwrite: int,
__errread: int,
__errwrite: int,
__errpipe_read: int,
__errpipe_write: int,
__restore_signals: int,
__call_setsid: int,
__pgid_to_set: int,
__gid: SupportsIndex | None,
__extra_groups: list[int] | None,
__uid: SupportsIndex | None,
__child_umask: int,
__preexec_fn: Callable[[], None],
__allow_vfork: bool,
args: Sequence[StrOrBytesPath] | None,
executable_list: Sequence[bytes],
close_fds: bool,
pass_fds: tuple[int, ...],
cwd: str,
env: Sequence[bytes] | None,
p2cread: int,
p2cwrite: int,
c2pread: int,
c2pwrite: int,
errread: int,
errwrite: int,
errpipe_read: int,
errpipe_write: int,
restore_signals: int,
call_setsid: int,
pgid_to_set: int,
gid: SupportsIndex | None,
extra_groups: list[int] | None,
uid: SupportsIndex | None,
child_umask: int,
preexec_fn: Callable[[], None],
allow_vfork: bool,
/,
) -> int: ...

View File

@@ -9,6 +9,6 @@ def get_cache_token() -> _CacheToken: ...
class ABCMeta(type):
def __new__(
__mcls: type[_typeshed.Self], __name: str, __bases: tuple[type[Any], ...], __namespace: dict[str, Any]
mcls: type[_typeshed.Self], name: str, bases: tuple[type[Any], ...], namespace: dict[str, Any], /
) -> _typeshed.Self: ...
def register(cls, subclass: type[_T]) -> type[_T]: ...

View File

@@ -5,8 +5,8 @@ _State: TypeAlias = tuple[int, ...]
class Random:
def __init__(self, seed: object = ...) -> None: ...
def seed(self, __n: object = None) -> None: ...
def seed(self, n: object = None, /) -> None: ...
def getstate(self) -> _State: ...
def setstate(self, __state: _State) -> None: ...
def setstate(self, state: _State, /) -> None: ...
def random(self) -> float: ...
def getrandbits(self, __k: int) -> int: ...
def getrandbits(self, k: int, /) -> int: ...

View File

@@ -696,70 +696,71 @@ class socket:
else:
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: SupportsIndex | None = ...) -> None: ...
def bind(self, __address: _Address) -> None: ...
def bind(self, address: _Address, /) -> None: ...
def close(self) -> None: ...
def connect(self, __address: _Address) -> None: ...
def connect_ex(self, __address: _Address) -> int: ...
def connect(self, address: _Address, /) -> None: ...
def connect_ex(self, address: _Address, /) -> int: ...
def detach(self) -> int: ...
def fileno(self) -> int: ...
def getpeername(self) -> _RetAddress: ...
def getsockname(self) -> _RetAddress: ...
@overload
def getsockopt(self, __level: int, __optname: int) -> int: ...
def getsockopt(self, level: int, optname: int, /) -> int: ...
@overload
def getsockopt(self, __level: int, __optname: int, __buflen: int) -> bytes: ...
def getsockopt(self, level: int, optname: int, buflen: int, /) -> bytes: ...
def getblocking(self) -> bool: ...
def gettimeout(self) -> float | None: ...
if sys.platform == "win32":
def ioctl(self, __control: int, __option: int | tuple[int, int, int] | bool) -> None: ...
def ioctl(self, control: int, option: int | tuple[int, int, int] | bool, /) -> None: ...
def listen(self, __backlog: int = ...) -> None: ...
def recv(self, __bufsize: int, __flags: int = ...) -> bytes: ...
def recvfrom(self, __bufsize: int, __flags: int = ...) -> tuple[bytes, _RetAddress]: ...
def listen(self, backlog: int = ..., /) -> None: ...
def recv(self, bufsize: int, flags: int = ..., /) -> bytes: ...
def recvfrom(self, bufsize: int, flags: int = ..., /) -> tuple[bytes, _RetAddress]: ...
if sys.platform != "win32":
def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> tuple[bytes, list[_CMSG], int, Any]: ...
def recvmsg(self, bufsize: int, ancbufsize: int = ..., flags: int = ..., /) -> tuple[bytes, list[_CMSG], int, Any]: ...
def recvmsg_into(
self, __buffers: Iterable[WriteableBuffer], __ancbufsize: int = ..., __flags: int = ...
self, buffers: Iterable[WriteableBuffer], ancbufsize: int = ..., flags: int = ..., /
) -> tuple[int, list[_CMSG], int, Any]: ...
def recvfrom_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
def recv_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
def send(self, __data: ReadableBuffer, __flags: int = ...) -> int: ...
def sendall(self, __data: ReadableBuffer, __flags: int = ...) -> None: ...
def send(self, data: ReadableBuffer, flags: int = ..., /) -> int: ...
def sendall(self, data: ReadableBuffer, flags: int = ..., /) -> None: ...
@overload
def sendto(self, __data: ReadableBuffer, __address: _Address) -> int: ...
def sendto(self, data: ReadableBuffer, address: _Address, /) -> int: ...
@overload
def sendto(self, __data: ReadableBuffer, __flags: int, __address: _Address) -> int: ...
def sendto(self, data: ReadableBuffer, flags: int, address: _Address, /) -> int: ...
if sys.platform != "win32":
def sendmsg(
self,
__buffers: Iterable[ReadableBuffer],
__ancdata: Iterable[_CMSGArg] = ...,
__flags: int = ...,
__address: _Address | None = ...,
buffers: Iterable[ReadableBuffer],
ancdata: Iterable[_CMSGArg] = ...,
flags: int = ...,
address: _Address | None = ...,
/,
) -> int: ...
if sys.platform == "linux":
def sendmsg_afalg(
self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
) -> int: ...
def setblocking(self, __flag: bool) -> None: ...
def settimeout(self, __value: float | None) -> None: ...
def setblocking(self, flag: bool, /) -> None: ...
def settimeout(self, value: float | None, /) -> None: ...
@overload
def setsockopt(self, __level: int, __optname: int, __value: int | ReadableBuffer) -> None: ...
def setsockopt(self, level: int, optname: int, value: int | ReadableBuffer, /) -> None: ...
@overload
def setsockopt(self, __level: int, __optname: int, __value: None, __optlen: int) -> None: ...
def setsockopt(self, level: int, optname: int, value: None, optlen: int, /) -> None: ...
if sys.platform == "win32":
def share(self, __process_id: int) -> bytes: ...
def share(self, process_id: int, /) -> bytes: ...
def shutdown(self, __how: int) -> None: ...
def shutdown(self, how: int, /) -> None: ...
SocketType = socket
# ===== Functions =====
def close(__fd: SupportsIndex) -> None: ...
def dup(__fd: SupportsIndex) -> int: ...
def close(fd: SupportsIndex, /) -> None: ...
def dup(fd: SupportsIndex, /) -> int: ...
# the 5th tuple item is an address
def getaddrinfo(
@@ -770,33 +771,33 @@ def getaddrinfo(
proto: int = ...,
flags: int = ...,
) -> list[tuple[int, int, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
def gethostbyname(__hostname: str) -> str: ...
def gethostbyname_ex(__hostname: str) -> tuple[str, list[str], list[str]]: ...
def gethostbyname(hostname: str, /) -> str: ...
def gethostbyname_ex(hostname: str, /) -> tuple[str, list[str], list[str]]: ...
def gethostname() -> str: ...
def gethostbyaddr(__ip_address: str) -> tuple[str, list[str], list[str]]: ...
def getnameinfo(__sockaddr: tuple[str, int] | tuple[str, int, int, int], __flags: int) -> tuple[str, str]: ...
def getprotobyname(__protocolname: str) -> int: ...
def getservbyname(__servicename: str, __protocolname: str = ...) -> int: ...
def getservbyport(__port: int, __protocolname: str = ...) -> str: ...
def ntohl(__x: int) -> int: ... # param & ret val are 32-bit ints
def ntohs(__x: int) -> int: ... # param & ret val are 16-bit ints
def htonl(__x: int) -> int: ... # param & ret val are 32-bit ints
def htons(__x: int) -> int: ... # param & ret val are 16-bit ints
def inet_aton(__ip_string: str) -> bytes: ... # ret val 4 bytes in length
def inet_ntoa(__packed_ip: ReadableBuffer) -> str: ...
def inet_pton(__address_family: int, __ip_string: str) -> bytes: ...
def inet_ntop(__address_family: int, __packed_ip: ReadableBuffer) -> str: ...
def gethostbyaddr(ip_address: str, /) -> tuple[str, list[str], list[str]]: ...
def getnameinfo(sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int, /) -> tuple[str, str]: ...
def getprotobyname(protocolname: str, /) -> int: ...
def getservbyname(servicename: str, protocolname: str = ..., /) -> int: ...
def getservbyport(port: int, protocolname: str = ..., /) -> str: ...
def ntohl(x: int, /) -> int: ... # param & ret val are 32-bit ints
def ntohs(x: int, /) -> int: ... # param & ret val are 16-bit ints
def htonl(x: int, /) -> int: ... # param & ret val are 32-bit ints
def htons(x: int, /) -> int: ... # param & ret val are 16-bit ints
def inet_aton(ip_string: str, /) -> bytes: ... # ret val 4 bytes in length
def inet_ntoa(packed_ip: ReadableBuffer, /) -> str: ...
def inet_pton(address_family: int, ip_string: str, /) -> bytes: ...
def inet_ntop(address_family: int, packed_ip: ReadableBuffer, /) -> str: ...
def getdefaulttimeout() -> float | None: ...
def setdefaulttimeout(__timeout: float | None) -> None: ...
def setdefaulttimeout(timeout: float | None, /) -> None: ...
if sys.platform != "win32":
def sethostname(__name: str) -> None: ...
def CMSG_LEN(__length: int) -> int: ...
def CMSG_SPACE(__length: int) -> int: ...
def socketpair(__family: int = ..., __type: int = ..., __proto: int = ...) -> tuple[socket, socket]: ...
def sethostname(name: str, /) -> None: ...
def CMSG_LEN(length: int, /) -> int: ...
def CMSG_SPACE(length: int, /) -> int: ...
def socketpair(family: int = ..., type: int = ..., proto: int = ..., /) -> tuple[socket, socket]: ...
def if_nameindex() -> list[tuple[int, str]]: ...
def if_nametoindex(__name: str) -> int: ...
def if_indextoname(__index: int) -> str: ...
def if_nametoindex(name: str, /) -> int: ...
def if_indextoname(index: int, /) -> str: ...
CAPI: object

View File

@@ -54,6 +54,6 @@ if sys.version_info >= (3, 12):
def daemon_threads_allowed() -> bool: ...
class _local:
def __getattribute__(self, __name: str) -> Any: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __delattr__(self, __name: str) -> None: ...
def __getattribute__(self, name: str, /) -> Any: ...
def __setattr__(self, name: str, value: Any, /) -> None: ...
def __delattr__(self, name: str, /) -> None: ...

View File

@@ -21,12 +21,12 @@ class Tcl_Obj:
@property
def typename(self) -> str: ...
__hash__: ClassVar[None] # type: ignore[assignment]
def __eq__(self, __value): ...
def __ge__(self, __value): ...
def __gt__(self, __value): ...
def __le__(self, __value): ...
def __lt__(self, __value): ...
def __ne__(self, __value): ...
def __eq__(self, value, /): ...
def __ge__(self, value, /): ...
def __gt__(self, value, /): ...
def __le__(self, value, /): ...
def __lt__(self, value, /): ...
def __ne__(self, value, /): ...
class TclError(Exception): ...
@@ -50,39 +50,39 @@ class TclError(Exception): ...
@final
class TkappType:
# Please keep in sync with tkinter.Tk
def adderrorinfo(self, __msg): ...
def call(self, __command: Any, *args: Any) -> Any: ...
def createcommand(self, __name, __func): ...
def adderrorinfo(self, msg, /): ...
def call(self, command: Any, /, *args: Any) -> Any: ...
def createcommand(self, name, func, /): ...
if sys.platform != "win32":
def createfilehandler(self, __file, __mask, __func): ...
def deletefilehandler(self, __file): ...
def createfilehandler(self, file, mask, func, /): ...
def deletefilehandler(self, file, /): ...
def createtimerhandler(self, __milliseconds, __func): ...
def deletecommand(self, __name): ...
def dooneevent(self, __flags: int = 0): ...
def eval(self, __script: str) -> str: ...
def evalfile(self, __fileName): ...
def exprboolean(self, __s): ...
def exprdouble(self, __s): ...
def exprlong(self, __s): ...
def exprstring(self, __s): ...
def getboolean(self, __arg): ...
def getdouble(self, __arg): ...
def getint(self, __arg): ...
def createtimerhandler(self, milliseconds, func, /): ...
def deletecommand(self, name, /): ...
def dooneevent(self, flags: int = 0, /): ...
def eval(self, script: str, /) -> str: ...
def evalfile(self, fileName, /): ...
def exprboolean(self, s, /): ...
def exprdouble(self, s, /): ...
def exprlong(self, s, /): ...
def exprstring(self, s, /): ...
def getboolean(self, arg, /): ...
def getdouble(self, arg, /): ...
def getint(self, arg, /): ...
def getvar(self, *args, **kwargs): ...
def globalgetvar(self, *args, **kwargs): ...
def globalsetvar(self, *args, **kwargs): ...
def globalunsetvar(self, *args, **kwargs): ...
def interpaddr(self): ...
def loadtk(self) -> None: ...
def mainloop(self, __threshold: int = 0): ...
def mainloop(self, threshold: int = 0, /): ...
def quit(self): ...
def record(self, __script): ...
def record(self, script, /): ...
def setvar(self, *ags, **kwargs): ...
if sys.version_info < (3, 11):
def split(self, __arg): ...
def split(self, arg, /): ...
def splitlist(self, __arg): ...
def splitlist(self, arg, /): ...
def unsetvar(self, *args, **kwargs): ...
def wantobjects(self, *args, **kwargs): ...
def willdispatch(self): ...
@@ -107,14 +107,15 @@ class TkttType:
def deletetimerhandler(self): ...
def create(
__screenName: str | None = None,
__baseName: str = "",
__className: str = "Tk",
__interactive: bool = False,
__wantobjects: bool = False,
__wantTk: bool = True,
__sync: bool = False,
__use: str | None = None,
screenName: str | None = None,
baseName: str = "",
className: str = "Tk",
interactive: bool = False,
wantobjects: bool = False,
wantTk: bool = True,
sync: bool = False,
use: str | None = None,
/,
): ...
def getbusywaitinterval(): ...
def setbusywaitinterval(__new_val): ...
def setbusywaitinterval(new_val, /): ...

View File

@@ -2,7 +2,7 @@ import sys
from collections.abc import Sequence
from tracemalloc import _FrameTuple, _TraceTuple
def _get_object_traceback(__obj: object) -> Sequence[_FrameTuple] | None: ...
def _get_object_traceback(obj: object, /) -> Sequence[_FrameTuple] | None: ...
def _get_traces() -> Sequence[_TraceTuple]: ...
def clear_traces() -> None: ...
def get_traceback_limit() -> int: ...
@@ -13,5 +13,5 @@ def is_tracing() -> bool: ...
if sys.version_info >= (3, 9):
def reset_peak() -> None: ...
def start(__nframe: int = 1) -> None: ...
def start(nframe: int = 1, /) -> None: ...
def stop() -> None: ...

View File

@@ -67,7 +67,7 @@ sentinel: Any
# stable
class IdentityFunction(Protocol):
def __call__(self, __x: _T) -> _T: ...
def __call__(self, x: _T, /) -> _T: ...
# stable
class SupportsNext(Protocol[_T_co]):
@@ -80,16 +80,16 @@ class SupportsAnext(Protocol[_T_co]):
# Comparison protocols
class SupportsDunderLT(Protocol[_T_contra]):
def __lt__(self, __other: _T_contra) -> bool: ...
def __lt__(self, other: _T_contra, /) -> bool: ...
class SupportsDunderGT(Protocol[_T_contra]):
def __gt__(self, __other: _T_contra) -> bool: ...
def __gt__(self, other: _T_contra, /) -> bool: ...
class SupportsDunderLE(Protocol[_T_contra]):
def __le__(self, __other: _T_contra) -> bool: ...
def __le__(self, other: _T_contra, /) -> bool: ...
class SupportsDunderGE(Protocol[_T_contra]):
def __ge__(self, __other: _T_contra) -> bool: ...
def __ge__(self, other: _T_contra, /) -> bool: ...
class SupportsAllComparisons(
SupportsDunderLT[Any], SupportsDunderGT[Any], SupportsDunderLE[Any], SupportsDunderGE[Any], Protocol
@@ -101,22 +101,22 @@ SupportsRichComparisonT = TypeVar("SupportsRichComparisonT", bound=SupportsRichC
# Dunder protocols
class SupportsAdd(Protocol[_T_contra, _T_co]):
def __add__(self, __x: _T_contra) -> _T_co: ...
def __add__(self, x: _T_contra, /) -> _T_co: ...
class SupportsRAdd(Protocol[_T_contra, _T_co]):
def __radd__(self, __x: _T_contra) -> _T_co: ...
def __radd__(self, x: _T_contra, /) -> _T_co: ...
class SupportsSub(Protocol[_T_contra, _T_co]):
def __sub__(self, __x: _T_contra) -> _T_co: ...
def __sub__(self, x: _T_contra, /) -> _T_co: ...
class SupportsRSub(Protocol[_T_contra, _T_co]):
def __rsub__(self, __x: _T_contra) -> _T_co: ...
def __rsub__(self, x: _T_contra, /) -> _T_co: ...
class SupportsDivMod(Protocol[_T_contra, _T_co]):
def __divmod__(self, __other: _T_contra) -> _T_co: ...
def __divmod__(self, other: _T_contra, /) -> _T_co: ...
class SupportsRDivMod(Protocol[_T_contra, _T_co]):
def __rdivmod__(self, __other: _T_contra) -> _T_co: ...
def __rdivmod__(self, other: _T_contra, /) -> _T_co: ...
# This protocol is generic over the iterator type, while Iterable is
# generic over the type that is iterated over.
@@ -130,7 +130,7 @@ class SupportsAiter(Protocol[_T_co]):
class SupportsLenAndGetItem(Protocol[_T_co]):
def __len__(self) -> int: ...
def __getitem__(self, __k: int) -> _T_co: ...
def __getitem__(self, k: int, /) -> _T_co: ...
class SupportsTrunc(Protocol):
def __trunc__(self) -> int: ...
@@ -144,17 +144,17 @@ class SupportsItems(Protocol[_KT_co, _VT_co]):
# stable
class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]):
def keys(self) -> Iterable[_KT]: ...
def __getitem__(self, __key: _KT) -> _VT_co: ...
def __getitem__(self, key: _KT, /) -> _VT_co: ...
# stable
class SupportsGetItem(Protocol[_KT_contra, _VT_co]):
def __contains__(self, __x: Any) -> bool: ...
def __getitem__(self, __key: _KT_contra) -> _VT_co: ...
def __contains__(self, x: Any, /) -> bool: ...
def __getitem__(self, key: _KT_contra, /) -> _VT_co: ...
# stable
class SupportsItemAccess(SupportsGetItem[_KT_contra, _VT], Protocol[_KT_contra, _VT]):
def __setitem__(self, __key: _KT_contra, __value: _VT) -> None: ...
def __delitem__(self, __key: _KT_contra) -> None: ...
def __setitem__(self, key: _KT_contra, value: _VT, /) -> None: ...
def __delitem__(self, key: _KT_contra, /) -> None: ...
StrPath: TypeAlias = str | PathLike[str] # stable
BytesPath: TypeAlias = bytes | PathLike[bytes] # stable
@@ -238,11 +238,11 @@ FileDescriptorOrPath: TypeAlias = int | StrOrBytesPath
# stable
class SupportsRead(Protocol[_T_co]):
def read(self, __length: int = ...) -> _T_co: ...
def read(self, length: int = ..., /) -> _T_co: ...
# stable
class SupportsReadline(Protocol[_T_co]):
def readline(self, __length: int = ...) -> _T_co: ...
def readline(self, length: int = ..., /) -> _T_co: ...
# stable
class SupportsNoArgReadline(Protocol[_T_co]):
@@ -250,7 +250,7 @@ class SupportsNoArgReadline(Protocol[_T_co]):
# stable
class SupportsWrite(Protocol[_T_contra]):
def write(self, __s: _T_contra) -> object: ...
def write(self, s: _T_contra, /) -> object: ...
# stable
class SupportsFlush(Protocol):
@@ -267,17 +267,17 @@ WriteableBuffer: TypeAlias = Buffer
ReadableBuffer: TypeAlias = Buffer # stable
class SliceableBuffer(Buffer, Protocol):
def __getitem__(self, __slice: slice) -> Sequence[int]: ...
def __getitem__(self, slice: slice, /) -> Sequence[int]: ...
class IndexableBuffer(Buffer, Protocol):
def __getitem__(self, __i: int) -> int: ...
def __getitem__(self, i: int, /) -> int: ...
class SupportsGetItemBuffer(SliceableBuffer, IndexableBuffer, Protocol):
def __contains__(self, __x: Any) -> bool: ...
def __contains__(self, x: Any, /) -> bool: ...
@overload
def __getitem__(self, __slice: slice) -> Sequence[int]: ...
def __getitem__(self, slice: slice, /) -> Sequence[int]: ...
@overload
def __getitem__(self, __i: int) -> int: ...
def __getitem__(self, i: int, /) -> int: ...
class SizedBuffer(Sized, Buffer, Protocol): ...

View File

@@ -25,13 +25,13 @@ class DBAPICursor(Protocol):
# optional:
# def callproc(self, __procname: str, __parameters: Sequence[Any] = ...) -> Sequence[Any]: ...
def close(self) -> object: ...
def execute(self, __operation: str, __parameters: Sequence[Any] | Mapping[str, Any] = ...) -> object: ...
def executemany(self, __operation: str, __seq_of_parameters: Sequence[Sequence[Any]]) -> object: ...
def execute(self, operation: str, parameters: Sequence[Any] | Mapping[str, Any] = ..., /) -> object: ...
def executemany(self, operation: str, seq_of_parameters: Sequence[Sequence[Any]], /) -> object: ...
def fetchone(self) -> Sequence[Any] | None: ...
def fetchmany(self, __size: int = ...) -> Sequence[Sequence[Any]]: ...
def fetchmany(self, size: int = ..., /) -> Sequence[Sequence[Any]]: ...
def fetchall(self) -> Sequence[Sequence[Any]]: ...
# optional:
# def nextset(self) -> None | Literal[True]: ...
arraysize: int
def setinputsizes(self, __sizes: Sequence[DBAPITypeCode | int | None]) -> object: ...
def setoutputsize(self, __size: int, __column: int = ...) -> object: ...
def setinputsizes(self, sizes: Sequence[DBAPITypeCode | int | None], /) -> object: ...
def setoutputsize(self, size: int, column: int = ..., /) -> object: ...

View File

@@ -11,7 +11,7 @@ from typing import Any, Protocol
from typing_extensions import TypeAlias
class _Readable(Protocol):
def read(self, __size: int = ...) -> bytes: ...
def read(self, size: int = ..., /) -> bytes: ...
# Optional: def close(self) -> object: ...
if sys.version_info >= (3, 11):
@@ -20,7 +20,7 @@ else:
# stable
class StartResponse(Protocol):
def __call__(
self, __status: str, __headers: list[tuple[str, str]], __exc_info: OptExcInfo | None = ...
self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ..., /
) -> Callable[[bytes], object]: ...
WSGIEnvironment: TypeAlias = dict[str, Any] # stable
@@ -28,17 +28,17 @@ else:
# WSGI input streams per PEP 3333, stable
class InputStream(Protocol):
def read(self, __size: int = ...) -> bytes: ...
def readline(self, __size: int = ...) -> bytes: ...
def readlines(self, __hint: int = ...) -> list[bytes]: ...
def read(self, size: int = ..., /) -> bytes: ...
def readline(self, size: int = ..., /) -> bytes: ...
def readlines(self, hint: int = ..., /) -> list[bytes]: ...
def __iter__(self) -> Iterator[bytes]: ...
# WSGI error streams per PEP 3333, stable
class ErrorStream(Protocol):
def flush(self) -> object: ...
def write(self, __s: str) -> object: ...
def writelines(self, __seq: list[str]) -> object: ...
def write(self, s: str, /) -> object: ...
def writelines(self, seq: list[str], /) -> object: ...
# Optional file wrapper in wsgi.file_wrapper
class FileWrapper(Protocol):
def __call__(self, __file: _Readable, __block_size: int = ...) -> Iterable[bytes]: ...
def __call__(self, file: _Readable, block_size: int = ..., /) -> Iterable[bytes]: ...

View File

@@ -4,6 +4,6 @@ from typing import Any, Protocol
# As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects
class DOMImplementation(Protocol):
def hasFeature(self, __feature: str, __version: str | None) -> bool: ...
def createDocument(self, __namespaceUri: str, __qualifiedName: str, __doctype: Any | None) -> Any: ...
def createDocumentType(self, __qualifiedName: str, __publicId: str, __systemId: str) -> Any: ...
def hasFeature(self, feature: str, version: str | None, /) -> bool: ...
def createDocument(self, namespaceUri: str, qualifiedName: str, doctype: Any | None, /) -> Any: ...
def createDocumentType(self, qualifiedName: str, publicId: str, systemId: str, /) -> Any: ...

View File

@@ -11,31 +11,31 @@ _T = TypeVar("_T")
@final
class CallableProxyType(Generic[_C]): # "weakcallableproxy"
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
def __getattr__(self, attr: str) -> Any: ...
__call__: _C
@final
class ProxyType(Generic[_T]): # "weakproxy"
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
def __getattr__(self, attr: str) -> Any: ...
class ReferenceType(Generic[_T]):
__callback__: Callable[[ReferenceType[_T]], Any]
def __new__(cls, __o: _T, __callback: Callable[[ReferenceType[_T]], Any] | None = ...) -> Self: ...
def __new__(cls, o: _T, callback: Callable[[ReferenceType[_T]], Any] | None = ..., /) -> Self: ...
def __call__(self) -> _T | None: ...
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
ref = ReferenceType
def getweakrefcount(__object: Any) -> int: ...
def getweakrefs(__object: Any) -> list[Any]: ...
def getweakrefcount(object: Any, /) -> int: ...
def getweakrefs(object: Any, /) -> list[Any]: ...
# Return CallableProxyType if object is callable, ProxyType otherwise
@overload
def proxy(__object: _C, __callback: Callable[[_C], Any] | None = None) -> CallableProxyType[_C]: ...
def proxy(object: _C, callback: Callable[[_C], Any] | None = None, /) -> CallableProxyType[_C]: ...
@overload
def proxy(__object: _T, __callback: Callable[[_T], Any] | None = None) -> Any: ...
def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> Any: ...

View File

@@ -158,7 +158,7 @@ if sys.platform == "win32":
ERROR_ACCESS_DENIED: Literal[5]
ERROR_PRIVILEGE_NOT_HELD: Literal[1314]
def CloseHandle(__handle: int) -> None: ...
def CloseHandle(handle: int, /) -> None: ...
@overload
def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ...
@overload
@@ -166,59 +166,63 @@ if sys.platform == "win32":
@overload
def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ...
def CreateFile(
__file_name: str,
__desired_access: int,
__share_mode: int,
__security_attributes: int,
__creation_disposition: int,
__flags_and_attributes: int,
__template_file: int,
file_name: str,
desired_access: int,
share_mode: int,
security_attributes: int,
creation_disposition: int,
flags_and_attributes: int,
template_file: int,
/,
) -> int: ...
def CreateJunction(__src_path: str, __dst_path: str) -> None: ...
def CreateJunction(src_path: str, dst_path: str, /) -> None: ...
def CreateNamedPipe(
__name: str,
__open_mode: int,
__pipe_mode: int,
__max_instances: int,
__out_buffer_size: int,
__in_buffer_size: int,
__default_timeout: int,
__security_attributes: int,
name: str,
open_mode: int,
pipe_mode: int,
max_instances: int,
out_buffer_size: int,
in_buffer_size: int,
default_timeout: int,
security_attributes: int,
/,
) -> int: ...
def CreatePipe(__pipe_attrs: Any, __size: int) -> tuple[int, int]: ...
def CreatePipe(pipe_attrs: Any, size: int, /) -> tuple[int, int]: ...
def CreateProcess(
__application_name: str | None,
__command_line: str | None,
__proc_attrs: Any,
__thread_attrs: Any,
__inherit_handles: bool,
__creation_flags: int,
__env_mapping: dict[str, str],
__current_directory: str | None,
__startup_info: Any,
application_name: str | None,
command_line: str | None,
proc_attrs: Any,
thread_attrs: Any,
inherit_handles: bool,
creation_flags: int,
env_mapping: dict[str, str],
current_directory: str | None,
startup_info: Any,
/,
) -> tuple[int, int, int, int]: ...
def DuplicateHandle(
__source_process_handle: int,
__source_handle: int,
__target_process_handle: int,
__desired_access: int,
__inherit_handle: bool,
__options: int = 0,
source_process_handle: int,
source_handle: int,
target_process_handle: int,
desired_access: int,
inherit_handle: bool,
options: int = 0,
/,
) -> int: ...
def ExitProcess(__ExitCode: int) -> NoReturn: ...
def ExitProcess(ExitCode: int, /) -> NoReturn: ...
def GetACP() -> int: ...
def GetFileType(handle: int) -> int: ...
def GetCurrentProcess() -> int: ...
def GetExitCodeProcess(__process: int) -> int: ...
def GetExitCodeProcess(process: int, /) -> int: ...
def GetLastError() -> int: ...
def GetModuleFileName(__module_handle: int) -> str: ...
def GetStdHandle(__std_handle: int) -> int: ...
def GetModuleFileName(module_handle: int, /) -> str: ...
def GetStdHandle(std_handle: int, /) -> int: ...
def GetVersion() -> int: ...
def OpenProcess(__desired_access: int, __inherit_handle: bool, __process_id: int) -> int: ...
def PeekNamedPipe(__handle: int, __size: int = 0) -> tuple[int, int] | tuple[bytes, int, int]: ...
def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int, /) -> int: ...
def PeekNamedPipe(handle: int, size: int = 0, /) -> tuple[int, int] | tuple[bytes, int, int]: ...
if sys.version_info >= (3, 10):
def LCMapStringEx(locale: str, flags: int, src: str) -> str: ...
def UnmapViewOfFile(__address: int) -> None: ...
def UnmapViewOfFile(address: int, /) -> None: ...
@overload
def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
@@ -227,12 +231,12 @@ if sys.platform == "win32":
@overload
def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ...
def SetNamedPipeHandleState(
__named_pipe: int, __mode: int | None, __max_collection_count: int | None, __collect_data_timeout: int | None
named_pipe: int, mode: int | None, max_collection_count: int | None, collect_data_timeout: int | None, /
) -> None: ...
def TerminateProcess(__handle: int, __exit_code: int) -> None: ...
def WaitForMultipleObjects(__handle_seq: Sequence[int], __wait_flag: bool, __milliseconds: int = 0xFFFFFFFF) -> int: ...
def WaitForSingleObject(__handle: int, __milliseconds: int) -> int: ...
def WaitNamedPipe(__name: str, __timeout: int) -> None: ...
def TerminateProcess(handle: int, exit_code: int, /) -> None: ...
def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = 0xFFFFFFFF, /) -> int: ...
def WaitForSingleObject(handle: int, milliseconds: int, /) -> int: ...
def WaitNamedPipe(name: str, timeout: int, /) -> None: ...
@overload
def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
@overload
@@ -242,10 +246,10 @@ if sys.platform == "win32":
@final
class Overlapped:
event: int
def GetOverlappedResult(self, __wait: bool) -> tuple[int, int]: ...
def GetOverlappedResult(self, wait: bool, /) -> tuple[int, int]: ...
def cancel(self) -> None: ...
def getbuffer(self) -> bytes | None: ...
if sys.version_info >= (3, 12):
def CopyFile2(existing_file_name: str, new_file_name: str, flags: int, progress_routine: int | None = None) -> int: ...
def NeedCurrentDirectoryForExePath(__exe_name: str) -> bool: ...
def NeedCurrentDirectoryForExePath(exe_name: str, /) -> bool: ...

View File

@@ -15,7 +15,7 @@ class ABCMeta(type):
__abstractmethods__: frozenset[str]
if sys.version_info >= (3, 11):
def __new__(
__mcls: type[_typeshed.Self], __name: str, __bases: tuple[type, ...], __namespace: dict[str, Any], **kwargs: Any
mcls: type[_typeshed.Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], /, **kwargs: Any
) -> _typeshed.Self: ...
else:
def __new__(

View File

@@ -392,7 +392,7 @@ elif sys.version_info >= (3, 9):
class Namespace(_AttributeHolder):
def __init__(self, **kwargs: Any) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __setattr__(self, name: str, value: Any, /) -> None: ...
def __contains__(self, key: str) -> bool: ...
def __eq__(self, other: object) -> bool: ...

View File

@@ -24,68 +24,68 @@ class array(MutableSequence[_T]):
@property
def itemsize(self) -> int: ...
@overload
def __init__(self: array[int], __typecode: _IntTypeCode, __initializer: bytes | bytearray | Iterable[int] = ...) -> None: ...
def __init__(self: array[int], typecode: _IntTypeCode, initializer: bytes | bytearray | Iterable[int] = ..., /) -> None: ...
@overload
def __init__(
self: array[float], __typecode: _FloatTypeCode, __initializer: bytes | bytearray | Iterable[float] = ...
self: array[float], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[float] = ..., /
) -> None: ...
@overload
def __init__(
self: array[str], __typecode: _UnicodeTypeCode, __initializer: bytes | bytearray | Iterable[str] = ...
self: array[str], typecode: _UnicodeTypeCode, initializer: bytes | bytearray | Iterable[str] = ..., /
) -> None: ...
@overload
def __init__(self, __typecode: str, __initializer: Iterable[_T]) -> None: ...
def __init__(self, typecode: str, initializer: Iterable[_T], /) -> None: ...
@overload
def __init__(self, __typecode: str, __initializer: bytes | bytearray = ...) -> None: ...
def append(self, __v: _T) -> None: ...
def __init__(self, typecode: str, initializer: bytes | bytearray = ..., /) -> None: ...
def append(self, v: _T, /) -> None: ...
def buffer_info(self) -> tuple[int, int]: ...
def byteswap(self) -> None: ...
def count(self, __v: _T) -> int: ...
def extend(self, __bb: Iterable[_T]) -> None: ...
def frombytes(self, __buffer: ReadableBuffer) -> None: ...
def fromfile(self, __f: SupportsRead[bytes], __n: int) -> None: ...
def fromlist(self, __list: list[_T]) -> None: ...
def fromunicode(self, __ustr: str) -> None: ...
def count(self, v: _T, /) -> int: ...
def extend(self, bb: Iterable[_T], /) -> None: ...
def frombytes(self, buffer: ReadableBuffer, /) -> None: ...
def fromfile(self, f: SupportsRead[bytes], n: int, /) -> None: ...
def fromlist(self, list: list[_T], /) -> None: ...
def fromunicode(self, ustr: str, /) -> None: ...
if sys.version_info >= (3, 10):
def index(self, __v: _T, __start: int = 0, __stop: int = sys.maxsize) -> int: ...
def index(self, v: _T, start: int = 0, stop: int = sys.maxsize, /) -> int: ...
else:
def index(self, __v: _T) -> int: ... # type: ignore[override]
def index(self, v: _T, /) -> int: ... # type: ignore[override]
def insert(self, __i: int, __v: _T) -> None: ...
def pop(self, __i: int = -1) -> _T: ...
def remove(self, __v: _T) -> None: ...
def insert(self, i: int, v: _T, /) -> None: ...
def pop(self, i: int = -1, /) -> _T: ...
def remove(self, v: _T, /) -> None: ...
def tobytes(self) -> bytes: ...
def tofile(self, __f: SupportsWrite[bytes]) -> None: ...
def tofile(self, f: SupportsWrite[bytes], /) -> None: ...
def tolist(self) -> list[_T]: ...
def tounicode(self) -> str: ...
if sys.version_info < (3, 9):
def fromstring(self, __buffer: str | ReadableBuffer) -> None: ...
def fromstring(self, buffer: str | ReadableBuffer, /) -> None: ...
def tostring(self) -> bytes: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, __key: SupportsIndex) -> _T: ...
def __getitem__(self, key: SupportsIndex, /) -> _T: ...
@overload
def __getitem__(self, __key: slice) -> array[_T]: ...
def __getitem__(self, key: slice, /) -> array[_T]: ...
@overload # type: ignore[override]
def __setitem__(self, __key: SupportsIndex, __value: _T) -> None: ...
def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ...
@overload
def __setitem__(self, __key: slice, __value: array[_T]) -> None: ...
def __delitem__(self, __key: SupportsIndex | slice) -> None: ...
def __add__(self, __value: array[_T]) -> array[_T]: ...
def __eq__(self, __value: object) -> bool: ...
def __ge__(self, __value: array[_T]) -> bool: ...
def __gt__(self, __value: array[_T]) -> bool: ...
def __iadd__(self, __value: array[_T]) -> Self: ... # type: ignore[override]
def __imul__(self, __value: int) -> Self: ...
def __le__(self, __value: array[_T]) -> bool: ...
def __lt__(self, __value: array[_T]) -> bool: ...
def __mul__(self, __value: int) -> array[_T]: ...
def __rmul__(self, __value: int) -> array[_T]: ...
def __setitem__(self, key: slice, value: array[_T], /) -> None: ...
def __delitem__(self, key: SupportsIndex | slice, /) -> None: ...
def __add__(self, value: array[_T], /) -> array[_T]: ...
def __eq__(self, value: object, /) -> bool: ...
def __ge__(self, value: array[_T], /) -> bool: ...
def __gt__(self, value: array[_T], /) -> bool: ...
def __iadd__(self, value: array[_T], /) -> Self: ... # type: ignore[override]
def __imul__(self, value: int, /) -> Self: ...
def __le__(self, value: array[_T], /) -> bool: ...
def __lt__(self, value: array[_T], /) -> bool: ...
def __mul__(self, value: int, /) -> array[_T]: ...
def __rmul__(self, value: int, /) -> array[_T]: ...
def __copy__(self) -> array[_T]: ...
def __deepcopy__(self, __unused: Any) -> array[_T]: ...
def __buffer__(self, __flags: int) -> memoryview: ...
def __release_buffer__(self, __buffer: memoryview) -> None: ...
def __deepcopy__(self, unused: Any, /) -> array[_T]: ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...

View File

@@ -43,9 +43,7 @@ _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
_SSLContext: TypeAlias = bool | None | ssl.SSLContext
class _TaskFactory(Protocol):
def __call__(
self, __loop: AbstractEventLoop, __factory: Coroutine[Any, Any, _T] | Generator[Any, None, _T]
) -> Future[_T]: ...
def __call__(self, loop: AbstractEventLoop, factory: Coroutine[Any, Any, _T] | Generator[Any, None, _T], /) -> Future[_T]: ...
class Handle:
_cancelled: bool
@@ -577,6 +575,6 @@ else:
def get_child_watcher() -> AbstractChildWatcher: ...
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
def _set_running_loop(__loop: AbstractEventLoop | None) -> None: ...
def _set_running_loop(loop: AbstractEventLoop | None, /) -> None: ...
def _get_running_loop() -> AbstractEventLoop: ...
def get_running_loop() -> AbstractEventLoop: ...

View File

@@ -34,7 +34,7 @@ class Future(Awaitable[_T], Iterable[_T]):
def get_loop(self) -> AbstractEventLoop: ...
@property
def _callbacks(self) -> list[tuple[Callable[[Self], Any], Context]]: ...
def add_done_callback(self, __fn: Callable[[Self], object], *, context: Context | None = None) -> None: ...
def add_done_callback(self, fn: Callable[[Self], object], /, *, context: Context | None = None) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: Any | None = None) -> bool: ...
else:
@@ -44,9 +44,9 @@ class Future(Awaitable[_T], Iterable[_T]):
def done(self) -> bool: ...
def result(self) -> _T: ...
def exception(self) -> BaseException | None: ...
def remove_done_callback(self, __fn: Callable[[Self], object]) -> int: ...
def set_result(self, __result: _T) -> None: ...
def set_exception(self, __exception: type | BaseException) -> None: ...
def remove_done_callback(self, fn: Callable[[Self], object], /) -> int: ...
def set_result(self, result: _T, /) -> None: ...
def set_exception(self, exception: type | BaseException, /) -> None: ...
def __iter__(self) -> Generator[Any, None, _T]: ...
def __await__(self) -> Generator[Any, None, _T]: ...
@property

View File

@@ -98,81 +98,88 @@ def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | No
# N.B. Having overlapping overloads is the only way to get acceptable type inference in all edge cases.
if sys.version_info >= (3, 10):
@overload
def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: Literal[False] = False) -> Future[tuple[_T1]]: ... # type: ignore[overload-overlap]
def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: Literal[False] = False) -> Future[tuple[_T1]]: ... # type: ignore[overload-overlap]
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: Literal[False] = False
coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], /, *, return_exceptions: Literal[False] = False
) -> Future[tuple[_T1, _T2]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
__coro_or_future5: _FutureLike[_T5],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
__coro_or_future5: _FutureLike[_T5],
__coro_or_future6: _FutureLike[_T6],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
@overload
def gather(*coros_or_futures: _FutureLike[_T], return_exceptions: Literal[False] = False) -> Future[list[_T]]: ... # type: ignore[overload-overlap]
@overload
def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... # type: ignore[overload-overlap]
def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... # type: ignore[overload-overlap]
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: bool
coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], /, *, return_exceptions: bool
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/,
*,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/,
*,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
__coro_or_future5: _FutureLike[_T5],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
/,
*,
return_exceptions: bool,
) -> Future[
@@ -180,12 +187,13 @@ if sys.version_info >= (3, 10):
]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
__coro_or_future5: _FutureLike[_T5],
__coro_or_future6: _FutureLike[_T6],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/,
*,
return_exceptions: bool,
) -> Future[
@@ -204,54 +212,59 @@ if sys.version_info >= (3, 10):
else:
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: Literal[False] = False
coro_or_future1: _FutureLike[_T1], /, *, loop: AbstractEventLoop | None = None, return_exceptions: Literal[False] = False
) -> Future[tuple[_T1]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
__coro_or_future5: _FutureLike[_T5],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
__coro_or_future5: _FutureLike[_T5],
__coro_or_future6: _FutureLike[_T6],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
@@ -262,43 +275,47 @@ else:
) -> Future[list[_T]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: bool
coro_or_future1: _FutureLike[_T1], /, *, loop: AbstractEventLoop | None = None, return_exceptions: bool
) -> Future[tuple[_T1 | BaseException]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
@overload
def gather( # type: ignore[overload-overlap]
__coro_or_future1: _FutureLike[_T1],
__coro_or_future2: _FutureLike[_T2],
__coro_or_future3: _FutureLike[_T3],
__coro_or_future4: _FutureLike[_T4],
__coro_or_future5: _FutureLike[_T5],
__coro_or_future6: _FutureLike[_T6],
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
@@ -411,7 +428,7 @@ class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportIn
def get_coro(self) -> _TaskCompatibleCoro[_T_co]: ...
def get_name(self) -> str: ...
def set_name(self, __value: object) -> None: ...
def set_name(self, value: object, /) -> None: ...
if sys.version_info >= (3, 12):
def get_context(self) -> Context: ...
@@ -446,7 +463,8 @@ if sys.version_info >= (3, 12):
class _CustomTaskConstructor(Protocol[_TaskT_co]):
def __call__(
self,
__coro: _TaskCompatibleCoro[Any],
coro: _TaskCompatibleCoro[Any],
/,
*,
loop: AbstractEventLoop,
name: str | None,

View File

@@ -6,4 +6,4 @@ __all__ = ("to_thread",)
_P = ParamSpec("_P")
_R = TypeVar("_R")
async def to_thread(__func: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ...
async def to_thread(func: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R: ...

View File

@@ -51,7 +51,7 @@ class TransportSocket:
else:
def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> NoReturn: ...
def listen(self, __backlog: int = ...) -> None: ...
def listen(self, backlog: int = ..., /) -> None: ...
def makefile(self) -> BinaryIO: ...
def sendfile(self, file: BinaryIO, offset: int = ..., count: int | None = ...) -> int: ...
def close(self) -> None: ...
@@ -66,11 +66,7 @@ class TransportSocket:
) -> NoReturn: ...
def sendmsg(
self,
__buffers: Iterable[ReadableBuffer],
__ancdata: Iterable[_CMSG] = ...,
__flags: int = ...,
__address: _Address = ...,
self, buffers: Iterable[ReadableBuffer], ancdata: Iterable[_CMSG] = ..., flags: int = ..., address: _Address = ..., /
) -> int: ...
@overload
def sendto(self, data: ReadableBuffer, address: _Address) -> int: ...
@@ -87,9 +83,9 @@ class TransportSocket:
def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
def recvmsg_into(
self, __buffers: Iterable[_WriteBuffer], __ancbufsize: int = ..., __flags: int = ...
self, buffers: Iterable[_WriteBuffer], ancbufsize: int = ..., flags: int = ..., /
) -> tuple[int, list[_CMSG], int, Any]: ...
def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> tuple[bytes, list[_CMSG], int, Any]: ...
def recvmsg(self, bufsize: int, ancbufsize: int = ..., flags: int = ..., /) -> tuple[bytes, list[_CMSG], int, Any]: ...
def recvfrom(self, bufsize: int, flags: int = ...) -> tuple[bytes, _RetAddress]: ...
def recv(self, bufsize: int, flags: int = ...) -> bytes: ...
def __enter__(self) -> socket.socket: ...

View File

@@ -5,38 +5,39 @@ _RatecvState: TypeAlias = tuple[int, tuple[tuple[int, int], ...]]
class error(Exception): ...
def add(__fragment1: bytes, __fragment2: bytes, __width: int) -> bytes: ...
def adpcm2lin(__fragment: bytes, __width: int, __state: _AdpcmState | None) -> tuple[bytes, _AdpcmState]: ...
def alaw2lin(__fragment: bytes, __width: int) -> bytes: ...
def avg(__fragment: bytes, __width: int) -> int: ...
def avgpp(__fragment: bytes, __width: int) -> int: ...
def bias(__fragment: bytes, __width: int, __bias: int) -> bytes: ...
def byteswap(__fragment: bytes, __width: int) -> bytes: ...
def cross(__fragment: bytes, __width: int) -> int: ...
def findfactor(__fragment: bytes, __reference: bytes) -> float: ...
def findfit(__fragment: bytes, __reference: bytes) -> tuple[int, float]: ...
def findmax(__fragment: bytes, __length: int) -> int: ...
def getsample(__fragment: bytes, __width: int, __index: int) -> int: ...
def lin2adpcm(__fragment: bytes, __width: int, __state: _AdpcmState | None) -> tuple[bytes, _AdpcmState]: ...
def lin2alaw(__fragment: bytes, __width: int) -> bytes: ...
def lin2lin(__fragment: bytes, __width: int, __newwidth: int) -> bytes: ...
def lin2ulaw(__fragment: bytes, __width: int) -> bytes: ...
def max(__fragment: bytes, __width: int) -> int: ...
def maxpp(__fragment: bytes, __width: int) -> int: ...
def minmax(__fragment: bytes, __width: int) -> tuple[int, int]: ...
def mul(__fragment: bytes, __width: int, __factor: float) -> bytes: ...
def add(fragment1: bytes, fragment2: bytes, width: int, /) -> bytes: ...
def adpcm2lin(fragment: bytes, width: int, state: _AdpcmState | None, /) -> tuple[bytes, _AdpcmState]: ...
def alaw2lin(fragment: bytes, width: int, /) -> bytes: ...
def avg(fragment: bytes, width: int, /) -> int: ...
def avgpp(fragment: bytes, width: int, /) -> int: ...
def bias(fragment: bytes, width: int, bias: int, /) -> bytes: ...
def byteswap(fragment: bytes, width: int, /) -> bytes: ...
def cross(fragment: bytes, width: int, /) -> int: ...
def findfactor(fragment: bytes, reference: bytes, /) -> float: ...
def findfit(fragment: bytes, reference: bytes, /) -> tuple[int, float]: ...
def findmax(fragment: bytes, length: int, /) -> int: ...
def getsample(fragment: bytes, width: int, index: int, /) -> int: ...
def lin2adpcm(fragment: bytes, width: int, state: _AdpcmState | None, /) -> tuple[bytes, _AdpcmState]: ...
def lin2alaw(fragment: bytes, width: int, /) -> bytes: ...
def lin2lin(fragment: bytes, width: int, newwidth: int, /) -> bytes: ...
def lin2ulaw(fragment: bytes, width: int, /) -> bytes: ...
def max(fragment: bytes, width: int, /) -> int: ...
def maxpp(fragment: bytes, width: int, /) -> int: ...
def minmax(fragment: bytes, width: int, /) -> tuple[int, int]: ...
def mul(fragment: bytes, width: int, factor: float, /) -> bytes: ...
def ratecv(
__fragment: bytes,
__width: int,
__nchannels: int,
__inrate: int,
__outrate: int,
__state: _RatecvState | None,
__weightA: int = 1,
__weightB: int = 0,
fragment: bytes,
width: int,
nchannels: int,
inrate: int,
outrate: int,
state: _RatecvState | None,
weightA: int = 1,
weightB: int = 0,
/,
) -> tuple[bytes, _RatecvState]: ...
def reverse(__fragment: bytes, __width: int) -> bytes: ...
def rms(__fragment: bytes, __width: int) -> int: ...
def tomono(__fragment: bytes, __width: int, __lfactor: float, __rfactor: float) -> bytes: ...
def tostereo(__fragment: bytes, __width: int, __lfactor: float, __rfactor: float) -> bytes: ...
def ulaw2lin(__fragment: bytes, __width: int) -> bytes: ...
def reverse(fragment: bytes, width: int, /) -> bytes: ...
def rms(fragment: bytes, width: int, /) -> int: ...
def tomono(fragment: bytes, width: int, lfactor: float, rfactor: float, /) -> bytes: ...
def tostereo(fragment: bytes, width: int, lfactor: float, rfactor: float, /) -> bytes: ...
def ulaw2lin(fragment: bytes, width: int, /) -> bytes: ...

View File

@@ -67,7 +67,7 @@ class Bdb:
) -> None: ...
def runeval(self, expr: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ...
def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
class Breakpoint:
next: int

View File

@@ -6,31 +6,31 @@ from typing_extensions import TypeAlias
# or ASCII-only strings.
_AsciiBuffer: TypeAlias = str | ReadableBuffer
def a2b_uu(__data: _AsciiBuffer) -> bytes: ...
def b2a_uu(__data: ReadableBuffer, *, backtick: bool = False) -> bytes: ...
def a2b_uu(data: _AsciiBuffer, /) -> bytes: ...
def b2a_uu(data: ReadableBuffer, /, *, backtick: bool = False) -> bytes: ...
if sys.version_info >= (3, 11):
def a2b_base64(__data: _AsciiBuffer, *, strict_mode: bool = False) -> bytes: ...
def a2b_base64(data: _AsciiBuffer, /, *, strict_mode: bool = False) -> bytes: ...
else:
def a2b_base64(__data: _AsciiBuffer) -> bytes: ...
def a2b_base64(data: _AsciiBuffer, /) -> bytes: ...
def b2a_base64(__data: ReadableBuffer, *, newline: bool = True) -> bytes: ...
def b2a_base64(data: ReadableBuffer, /, *, newline: bool = True) -> bytes: ...
def a2b_qp(data: _AsciiBuffer, header: bool = False) -> bytes: ...
def b2a_qp(data: ReadableBuffer, quotetabs: bool = False, istext: bool = True, header: bool = False) -> bytes: ...
if sys.version_info < (3, 11):
def a2b_hqx(__data: _AsciiBuffer) -> bytes: ...
def rledecode_hqx(__data: ReadableBuffer) -> bytes: ...
def rlecode_hqx(__data: ReadableBuffer) -> bytes: ...
def b2a_hqx(__data: ReadableBuffer) -> bytes: ...
def a2b_hqx(data: _AsciiBuffer, /) -> bytes: ...
def rledecode_hqx(data: ReadableBuffer, /) -> bytes: ...
def rlecode_hqx(data: ReadableBuffer, /) -> bytes: ...
def b2a_hqx(data: ReadableBuffer, /) -> bytes: ...
def crc_hqx(__data: ReadableBuffer, __crc: int) -> int: ...
def crc32(__data: ReadableBuffer, __crc: int = 0) -> int: ...
def crc_hqx(data: ReadableBuffer, crc: int, /) -> int: ...
def crc32(data: ReadableBuffer, crc: int = 0, /) -> int: ...
def b2a_hex(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = ...) -> bytes: ...
def hexlify(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = ...) -> bytes: ...
def a2b_hex(__hexstr: _AsciiBuffer) -> bytes: ...
def unhexlify(__hexstr: _AsciiBuffer) -> bytes: ...
def a2b_hex(hexstr: _AsciiBuffer, /) -> bytes: ...
def unhexlify(hexstr: _AsciiBuffer, /) -> bytes: ...
class Error(ValueError): ...
class Incomplete(Exception): ...

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@ __all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor", "open", "compress", "d
class _ReadableFileobj(_compression._Reader, Protocol): ...
class _WritableFileobj(Protocol):
def write(self, __b: bytes) -> object: ...
def write(self, b: bytes, /) -> object: ...
# The following attributes and methods are optional:
# def fileno(self) -> int: ...
# def close(self) -> object: ...
@@ -132,7 +132,7 @@ class BZ2File(BaseStream, IO[bytes]):
@final
class BZ2Compressor:
def __init__(self, compresslevel: int = ...) -> None: ...
def compress(self, __data: ReadableBuffer) -> bytes: ...
def compress(self, data: ReadableBuffer, /) -> bytes: ...
def flush(self) -> bytes: ...
@final

View File

@@ -24,7 +24,7 @@ class Profile(_lsprof.Profiler):
def snapshot_stats(self) -> None: ...
def run(self, cmd: str) -> Self: ...
def runctx(self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ...
def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kw: _P.kwargs) -> _T: ...
def __enter__(self) -> Self: ...
def __exit__(self, *exc_info: Unused) -> None: ...

View File

@@ -33,7 +33,7 @@ def parse_multipart(
) -> dict[str, list[Any]]: ...
class _Environ(Protocol):
def __getitem__(self, __k: str) -> str: ...
def __getitem__(self, k: str, /) -> str: ...
def keys(self) -> Iterable[str]: ...
def parse_header(line: str) -> tuple[str, dict[str, str]]: ...

View File

@@ -11,26 +11,26 @@ tau: float
_C: TypeAlias = SupportsFloat | SupportsComplex | SupportsIndex | complex
def acos(__z: _C) -> complex: ...
def acosh(__z: _C) -> complex: ...
def asin(__z: _C) -> complex: ...
def asinh(__z: _C) -> complex: ...
def atan(__z: _C) -> complex: ...
def atanh(__z: _C) -> complex: ...
def cos(__z: _C) -> complex: ...
def cosh(__z: _C) -> complex: ...
def exp(__z: _C) -> complex: ...
def acos(z: _C, /) -> complex: ...
def acosh(z: _C, /) -> complex: ...
def asin(z: _C, /) -> complex: ...
def asinh(z: _C, /) -> complex: ...
def atan(z: _C, /) -> complex: ...
def atanh(z: _C, /) -> complex: ...
def cos(z: _C, /) -> complex: ...
def cosh(z: _C, /) -> complex: ...
def exp(z: _C, /) -> complex: ...
def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = 1e-09, abs_tol: SupportsFloat = 0.0) -> bool: ...
def isinf(__z: _C) -> bool: ...
def isnan(__z: _C) -> bool: ...
def log(__x: _C, __base: _C = ...) -> complex: ...
def log10(__z: _C) -> complex: ...
def phase(__z: _C) -> float: ...
def polar(__z: _C) -> tuple[float, float]: ...
def rect(__r: float, __phi: float) -> complex: ...
def sin(__z: _C) -> complex: ...
def sinh(__z: _C) -> complex: ...
def sqrt(__z: _C) -> complex: ...
def tan(__z: _C) -> complex: ...
def tanh(__z: _C) -> complex: ...
def isfinite(__z: _C) -> bool: ...
def isinf(z: _C, /) -> bool: ...
def isnan(z: _C, /) -> bool: ...
def log(x: _C, base: _C = ..., /) -> complex: ...
def log10(z: _C, /) -> complex: ...
def phase(z: _C, /) -> float: ...
def polar(z: _C, /) -> tuple[float, float]: ...
def rect(r: float, phi: float, /) -> complex: ...
def sin(z: _C, /) -> complex: ...
def sinh(z: _C, /) -> complex: ...
def sqrt(z: _C, /) -> complex: ...
def tan(z: _C, /) -> complex: ...
def tanh(z: _C, /) -> complex: ...
def isfinite(z: _C, /) -> bool: ...

View File

@@ -59,13 +59,13 @@ BOM64_BE: Literal[b"\x00\x00\xfe\xff"]
BOM64_LE: Literal[b"\xff\xfe\x00\x00"]
class _WritableStream(Protocol):
def write(self, __data: bytes) -> object: ...
def seek(self, __offset: int, __whence: int) -> object: ...
def write(self, data: bytes, /) -> object: ...
def seek(self, offset: int, whence: int, /) -> object: ...
def close(self) -> object: ...
class _ReadableStream(Protocol):
def read(self, __size: int = ...) -> bytes: ...
def seek(self, __offset: int, __whence: int) -> object: ...
def read(self, size: int = ..., /) -> bytes: ...
def seek(self, offset: int, whence: int, /) -> object: ...
def close(self) -> object: ...
class _Stream(_WritableStream, _ReadableStream, Protocol): ...
@@ -77,16 +77,16 @@ class _Stream(_WritableStream, _ReadableStream, Protocol): ...
# They were much more common in Python 2 than in Python 3.
class _Encoder(Protocol):
def __call__(self, __input: str, __errors: str = ...) -> tuple[bytes, int]: ... # signature of Codec().encode
def __call__(self, input: str, errors: str = ..., /) -> tuple[bytes, int]: ... # signature of Codec().encode
class _Decoder(Protocol):
def __call__(self, __input: bytes, __errors: str = ...) -> tuple[str, int]: ... # signature of Codec().decode
def __call__(self, input: bytes, errors: str = ..., /) -> tuple[str, int]: ... # signature of Codec().decode
class _StreamReader(Protocol):
def __call__(self, __stream: _ReadableStream, __errors: str = ...) -> StreamReader: ...
def __call__(self, stream: _ReadableStream, errors: str = ..., /) -> StreamReader: ...
class _StreamWriter(Protocol):
def __call__(self, __stream: _WritableStream, __errors: str = ...) -> StreamWriter: ...
def __call__(self, stream: _WritableStream, errors: str = ..., /) -> StreamWriter: ...
class _IncrementalEncoder(Protocol):
def __call__(self, errors: str = ...) -> IncrementalEncoder: ...

View File

@@ -49,21 +49,21 @@ class UserDict(MutableMapping[_KT, _VT]):
data: dict[_KT, _VT]
# __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics
@overload
def __init__(self, __dict: None = None) -> None: ...
def __init__(self, dict: None = None, /) -> None: ...
@overload
def __init__(self: UserDict[str, _VT], __dict: None = None, **kwargs: _VT) -> None: ...
def __init__(self: UserDict[str, _VT], dict: None = None, /, **kwargs: _VT) -> None: ...
@overload
def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT]) -> None: ...
def __init__(self, dict: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ...
@overload
def __init__(self: UserDict[str, _VT], __dict: SupportsKeysAndGetItem[str, _VT], **kwargs: _VT) -> None: ...
def __init__(self: UserDict[str, _VT], dict: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> None: ...
@overload
def __init__(self, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
def __init__(self, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ...
@overload
def __init__(self: UserDict[str, _VT], __iterable: Iterable[tuple[str, _VT]], **kwargs: _VT) -> None: ...
def __init__(self: UserDict[str, _VT], iterable: Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> None: ...
@overload
def __init__(self: UserDict[str, str], __iterable: Iterable[list[str]]) -> None: ...
def __init__(self: UserDict[str, str], iterable: Iterable[list[str]], /) -> None: ...
@overload
def __init__(self: UserDict[bytes, bytes], __iterable: Iterable[list[bytes]]) -> None: ...
def __init__(self: UserDict[bytes, bytes], iterable: Iterable[list[bytes]], /) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, key: _KT) -> _VT: ...
def __setitem__(self, key: _KT, item: _VT) -> None: ...
@@ -200,8 +200,8 @@ class UserString(Sequence[UserString]):
maketrans = str.maketrans
def partition(self, sep: str) -> tuple[str, str, str]: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: str | UserString) -> Self: ...
def removesuffix(self, __suffix: str | UserString) -> Self: ...
def removeprefix(self, prefix: str | UserString, /) -> Self: ...
def removesuffix(self, suffix: str | UserString, /) -> Self: ...
def replace(self, old: str | UserString, new: str | UserString, maxsplit: int = -1) -> Self: ...
def rfind(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ...
@@ -227,58 +227,58 @@ class deque(MutableSequence[_T]):
def __init__(self, *, maxlen: int | None = None) -> None: ...
@overload
def __init__(self, iterable: Iterable[_T], maxlen: int | None = None) -> None: ...
def append(self, __x: _T) -> None: ...
def appendleft(self, __x: _T) -> None: ...
def append(self, x: _T, /) -> None: ...
def appendleft(self, x: _T, /) -> None: ...
def copy(self) -> Self: ...
def count(self, __x: _T) -> int: ...
def extend(self, __iterable: Iterable[_T]) -> None: ...
def extendleft(self, __iterable: Iterable[_T]) -> None: ...
def insert(self, __i: int, __x: _T) -> None: ...
def index(self, __x: _T, __start: int = 0, __stop: int = ...) -> int: ...
def count(self, x: _T, /) -> int: ...
def extend(self, iterable: Iterable[_T], /) -> None: ...
def extendleft(self, iterable: Iterable[_T], /) -> None: ...
def insert(self, i: int, x: _T, /) -> None: ...
def index(self, x: _T, start: int = 0, stop: int = ..., /) -> int: ...
def pop(self) -> _T: ... # type: ignore[override]
def popleft(self) -> _T: ...
def remove(self, __value: _T) -> None: ...
def rotate(self, __n: int = 1) -> None: ...
def remove(self, value: _T, /) -> None: ...
def rotate(self, n: int = 1, /) -> None: ...
def __copy__(self) -> Self: ...
def __len__(self) -> int: ...
# These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores
def __getitem__(self, __key: SupportsIndex) -> _T: ... # type: ignore[override]
def __setitem__(self, __key: SupportsIndex, __value: _T) -> None: ... # type: ignore[override]
def __delitem__(self, __key: SupportsIndex) -> None: ... # type: ignore[override]
def __contains__(self, __key: object) -> bool: ...
def __getitem__(self, key: SupportsIndex, /) -> _T: ... # type: ignore[override]
def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ... # type: ignore[override]
def __delitem__(self, key: SupportsIndex, /) -> None: ... # type: ignore[override]
def __contains__(self, key: object, /) -> bool: ...
def __reduce__(self) -> tuple[type[Self], tuple[()], None, Iterator[_T]]: ...
def __iadd__(self, __value: Iterable[_T]) -> Self: ...
def __add__(self, __value: Self) -> Self: ...
def __mul__(self, __value: int) -> Self: ...
def __imul__(self, __value: int) -> Self: ...
def __lt__(self, __value: deque[_T]) -> bool: ...
def __le__(self, __value: deque[_T]) -> bool: ...
def __gt__(self, __value: deque[_T]) -> bool: ...
def __ge__(self, __value: deque[_T]) -> bool: ...
def __eq__(self, __value: object) -> bool: ...
def __iadd__(self, value: Iterable[_T], /) -> Self: ...
def __add__(self, value: Self, /) -> Self: ...
def __mul__(self, value: int, /) -> Self: ...
def __imul__(self, value: int, /) -> Self: ...
def __lt__(self, value: deque[_T], /) -> bool: ...
def __le__(self, value: deque[_T], /) -> bool: ...
def __gt__(self, value: deque[_T], /) -> bool: ...
def __ge__(self, value: deque[_T], /) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class Counter(dict[_T, int], Generic[_T]):
@overload
def __init__(self, __iterable: None = None) -> None: ...
def __init__(self, iterable: None = None, /) -> None: ...
@overload
def __init__(self: Counter[str], __iterable: None = None, **kwargs: int) -> None: ...
def __init__(self: Counter[str], iterable: None = None, /, **kwargs: int) -> None: ...
@overload
def __init__(self, __mapping: SupportsKeysAndGetItem[_T, int]) -> None: ...
def __init__(self, mapping: SupportsKeysAndGetItem[_T, int], /) -> None: ...
@overload
def __init__(self, __iterable: Iterable[_T]) -> None: ...
def __init__(self, iterable: Iterable[_T], /) -> None: ...
def copy(self) -> Self: ...
def elements(self) -> Iterator[_T]: ...
def most_common(self, n: int | None = None) -> list[tuple[_T, int]]: ...
@classmethod
def fromkeys(cls, iterable: Any, v: int | None = None) -> NoReturn: ... # type: ignore[override]
@overload
def subtract(self, __iterable: None = None) -> None: ...
def subtract(self, iterable: None = None, /) -> None: ...
@overload
def subtract(self, __mapping: Mapping[_T, int]) -> None: ...
def subtract(self, mapping: Mapping[_T, int], /) -> None: ...
@overload
def subtract(self, __iterable: Iterable[_T]) -> None: ...
def subtract(self, iterable: Iterable[_T], /) -> None: ...
# Unlike dict.update(), use Mapping instead of SupportsKeysAndGetItem for the first overload
# (source code does an `isinstance(other, Mapping)` check)
#
@@ -286,11 +286,11 @@ class Counter(dict[_T, int], Generic[_T]):
# (if it were `Iterable[_T] | Iterable[tuple[_T, int]]`,
# the tuples would be added as keys, breaking type safety)
@overload # type: ignore[override]
def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ...
def update(self, m: Mapping[_T, int], /, **kwargs: int) -> None: ...
@overload
def update(self, __iterable: Iterable[_T], **kwargs: int) -> None: ...
def update(self, iterable: Iterable[_T], /, **kwargs: int) -> None: ...
@overload
def update(self, __iterable: None = None, **kwargs: int) -> None: ...
def update(self, iterable: None = None, /, **kwargs: int) -> None: ...
def __missing__(self, key: _T) -> int: ...
def __delitem__(self, elem: object) -> None: ...
if sys.version_info >= (3, 10):
@@ -371,16 +371,16 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def pop(self, key: _KT, default: _VT) -> _VT: ...
@overload
def pop(self, key: _KT, default: _T) -> _VT | _T: ...
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
if sys.version_info >= (3, 9):
@overload
def __or__(self, __value: dict[_KT, _VT]) -> Self: ...
def __or__(self, value: dict[_KT, _VT], /) -> Self: ...
@overload
def __or__(self, __value: dict[_T1, _T2]) -> OrderedDict[_KT | _T1, _VT | _T2]: ...
def __or__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]: ...
@overload
def __ror__(self, __value: dict[_KT, _VT]) -> Self: ...
def __ror__(self, value: dict[_KT, _VT], /) -> Self: ...
@overload
def __ror__(self, __value: dict[_T1, _T2]) -> OrderedDict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc]
def __ror__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc]
class defaultdict(dict[_KT, _VT]):
default_factory: Callable[[], _VT] | None
@@ -389,39 +389,41 @@ class defaultdict(dict[_KT, _VT]):
@overload
def __init__(self: defaultdict[str, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None) -> None: ...
def __init__(self, default_factory: Callable[[], _VT] | None, /) -> None: ...
@overload
def __init__(self: defaultdict[str, _VT], __default_factory: Callable[[], _VT] | None, **kwargs: _VT) -> None: ...
def __init__(self: defaultdict[str, _VT], default_factory: Callable[[], _VT] | None, /, **kwargs: _VT) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, __map: SupportsKeysAndGetItem[_KT, _VT]) -> None: ...
def __init__(self, default_factory: Callable[[], _VT] | None, map: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ...
@overload
def __init__(
self: defaultdict[str, _VT],
__default_factory: Callable[[], _VT] | None,
__map: SupportsKeysAndGetItem[str, _VT],
default_factory: Callable[[], _VT] | None,
map: SupportsKeysAndGetItem[str, _VT],
/,
**kwargs: _VT,
) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ...
@overload
def __init__(
self: defaultdict[str, _VT],
__default_factory: Callable[[], _VT] | None,
__iterable: Iterable[tuple[str, _VT]],
default_factory: Callable[[], _VT] | None,
iterable: Iterable[tuple[str, _VT]],
/,
**kwargs: _VT,
) -> None: ...
def __missing__(self, __key: _KT) -> _VT: ...
def __missing__(self, key: _KT, /) -> _VT: ...
def __copy__(self) -> Self: ...
def copy(self) -> Self: ...
if sys.version_info >= (3, 9):
@overload
def __or__(self, __value: dict[_KT, _VT]) -> Self: ...
def __or__(self, value: dict[_KT, _VT], /) -> Self: ...
@overload
def __or__(self, __value: dict[_T1, _T2]) -> defaultdict[_KT | _T1, _VT | _T2]: ...
def __or__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]: ...
@overload
def __ror__(self, __value: dict[_KT, _VT]) -> Self: ...
def __ror__(self, value: dict[_KT, _VT], /) -> Self: ...
@overload
def __ror__(self, __value: dict[_T1, _T2]) -> defaultdict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc]
def __ror__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc]
class ChainMap(MutableMapping[_KT, _VT]):
maps: list[MutableMapping[_KT, _VT]]
@@ -460,7 +462,7 @@ class ChainMap(MutableMapping[_KT, _VT]):
def fromkeys(cls, iterable: Iterable[_T], __value: None = None) -> ChainMap[_T, Any | None]: ...
@classmethod
@overload
def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> ChainMap[_T, _S]: ...
def fromkeys(cls, iterable: Iterable[_T], value: _S, /) -> ChainMap[_T, _S]: ...
if sys.version_info >= (3, 9):
@overload
def __or__(self, other: Mapping[_KT, _VT]) -> Self: ...

View File

@@ -6,7 +6,7 @@ from typing import Any, Protocol
__all__ = ["compile_dir", "compile_file", "compile_path"]
class _SupportsSearch(Protocol):
def search(self, __string: str) -> Any: ...
def search(self, string: str, /) -> Any: ...
if sys.version_info >= (3, 10):
def compile_dir(

View File

@@ -58,7 +58,7 @@ class Future(Generic[_T]):
class Executor:
if sys.version_info >= (3, 9):
def submit(self, __fn: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ...
def submit(self, fn: Callable[_P, _T], /, *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ...
else:
def submit(self, fn: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ...

View File

@@ -42,7 +42,7 @@ class AbstractContextManager(Protocol[_T_co]):
def __enter__(self) -> _T_co: ...
@abstractmethod
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
) -> bool | None: ...
@runtime_checkable
@@ -50,7 +50,7 @@ class AbstractAsyncContextManager(Protocol[_T_co]):
async def __aenter__(self) -> _T_co: ...
@abstractmethod
async def __aexit__(
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
) -> bool | None: ...
class ContextDecorator:
@@ -145,12 +145,12 @@ class redirect_stderr(_RedirectStream[_T_io]): ...
class ExitStack(metaclass=abc.ABCMeta):
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
def callback(self, callback: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
def pop_all(self) -> Self: ...
def close(self) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
) -> bool: ...
_ExitCoroFunc: TypeAlias = Callable[
@@ -165,15 +165,15 @@ class AsyncExitStack(metaclass=abc.ABCMeta):
async def enter_async_context(self, cm: AbstractAsyncContextManager[_T]) -> _T: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
def callback(self, callback: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
def push_async_callback(
self, __callback: Callable[_P, Awaitable[_T]], *args: _P.args, **kwds: _P.kwargs
self, callback: Callable[_P, Awaitable[_T]], /, *args: _P.args, **kwds: _P.kwargs
) -> Callable[_P, Awaitable[_T]]: ...
def pop_all(self) -> Self: ...
async def aclose(self) -> None: ...
async def __aenter__(self) -> Self: ...
async def __aexit__(
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
) -> bool: ...
if sys.version_info >= (3, 10):

View File

@@ -24,11 +24,11 @@ class ContextVar(Generic[_T]):
@overload
def get(self) -> _T: ...
@overload
def get(self, __default: _T) -> _T: ...
def get(self, default: _T, /) -> _T: ...
@overload
def get(self, __default: _D) -> _D | _T: ...
def set(self, __value: _T) -> Token[_T]: ...
def reset(self, __token: Token[_T]) -> None: ...
def get(self, default: _D, /) -> _D | _T: ...
def set(self, value: _T, /) -> Token[_T]: ...
def reset(self, token: Token[_T], /) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -50,14 +50,14 @@ def copy_context() -> Context: ...
class Context(Mapping[ContextVar[Any], Any]):
def __init__(self) -> None: ...
@overload
def get(self, __key: ContextVar[_T], __default: None = None) -> _T | None: ...
def get(self, key: ContextVar[_T], default: None = None, /) -> _T | None: ...
@overload
def get(self, __key: ContextVar[_T], __default: _T) -> _T: ...
def get(self, key: ContextVar[_T], default: _T, /) -> _T: ...
@overload
def get(self, __key: ContextVar[_T], __default: _D) -> _T | _D: ...
def get(self, key: ContextVar[_T], default: _D, /) -> _T | _D: ...
def run(self, callable: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
def copy(self) -> Context: ...
def __getitem__(self, __key: ContextVar[_T]) -> _T: ...
def __getitem__(self, key: ContextVar[_T], /) -> _T: ...
def __iter__(self) -> Iterator[ContextVar[Any]]: ...
def __len__(self) -> int: ...
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...

View File

@@ -18,4 +18,4 @@ if sys.platform != "win32":
COLORS: int
COLOR_PAIRS: int
def wrapper(__func: Callable[Concatenate[_CursesWindow, _P], _T], *arg: _P.args, **kwds: _P.kwargs) -> _T: ...
def wrapper(func: Callable[Concatenate[_CursesWindow, _P], _T], /, *arg: _P.args, **kwds: _P.kwargs) -> _T: ...

View File

@@ -20,6 +20,6 @@ if sys.platform != "win32":
def window(self) -> _CursesWindow: ...
def bottom_panel() -> _Curses_Panel: ...
def new_panel(__win: _CursesWindow) -> _Curses_Panel: ...
def new_panel(win: _CursesWindow, /) -> _Curses_Panel: ...
def top_panel() -> _Curses_Panel: ...
def update_panels() -> _Curses_Panel: ...

View File

@@ -55,9 +55,9 @@ def astuple(obj: DataclassInstance) -> tuple[Any, ...]: ...
@overload
def astuple(obj: DataclassInstance, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ...
@overload
def dataclass(__cls: None) -> Callable[[type[_T]], type[_T]]: ...
def dataclass(cls: None, /) -> Callable[[type[_T]], type[_T]]: ...
@overload
def dataclass(__cls: type[_T]) -> type[_T]: ...
def dataclass(cls: type[_T], /) -> type[_T]: ...
if sys.version_info >= (3, 11):
@overload
@@ -310,4 +310,4 @@ else:
frozen: bool = False,
) -> type: ...
def replace(__obj: _DataclassT, **changes: Any) -> _DataclassT: ...
def replace(obj: _DataclassT, /, **changes: Any) -> _DataclassT: ...

View File

@@ -14,12 +14,12 @@ MAXYEAR: Literal[9999]
class tzinfo:
@abstractmethod
def tzname(self, __dt: datetime | None) -> str | None: ...
def tzname(self, dt: datetime | None, /) -> str | None: ...
@abstractmethod
def utcoffset(self, __dt: datetime | None) -> timedelta | None: ...
def utcoffset(self, dt: datetime | None, /) -> timedelta | None: ...
@abstractmethod
def dst(self, __dt: datetime | None) -> timedelta | None: ...
def fromutc(self, __dt: datetime) -> datetime: ...
def dst(self, dt: datetime | None, /) -> timedelta | None: ...
def fromutc(self, dt: datetime, /) -> datetime: ...
# Alias required to avoid name conflicts with date(time).tzinfo.
_TzInfo: TypeAlias = tzinfo
@@ -30,11 +30,11 @@ class timezone(tzinfo):
min: ClassVar[timezone]
max: ClassVar[timezone]
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
def tzname(self, __dt: datetime | None) -> str: ...
def utcoffset(self, __dt: datetime | None) -> timedelta: ...
def dst(self, __dt: datetime | None) -> None: ...
def tzname(self, dt: datetime | None, /) -> str: ...
def utcoffset(self, dt: datetime | None, /) -> timedelta: ...
def dst(self, dt: datetime | None, /) -> None: ...
def __hash__(self) -> int: ...
def __eq__(self, __value: object) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
if sys.version_info >= (3, 11):
UTC: timezone
@@ -51,13 +51,13 @@ class date:
resolution: ClassVar[timedelta]
def __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> Self: ...
@classmethod
def fromtimestamp(cls, __timestamp: float) -> Self: ...
def fromtimestamp(cls, timestamp: float, /) -> Self: ...
@classmethod
def today(cls) -> Self: ...
@classmethod
def fromordinal(cls, __n: int) -> Self: ...
def fromordinal(cls, n: int, /) -> Self: ...
@classmethod
def fromisoformat(cls, __date_string: str) -> Self: ...
def fromisoformat(cls, date_string: str, /) -> Self: ...
@classmethod
def fromisocalendar(cls, year: int, week: int, day: int) -> Self: ...
@property
@@ -73,26 +73,26 @@ class date:
if sys.version_info >= (3, 12):
def strftime(self, format: str) -> str: ...
else:
def strftime(self, __format: str) -> str: ...
def strftime(self, format: str, /) -> str: ...
def __format__(self, __fmt: str) -> str: ...
def __format__(self, fmt: str, /) -> str: ...
def isoformat(self) -> str: ...
def timetuple(self) -> struct_time: ...
def toordinal(self) -> int: ...
def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ...
def __le__(self, __value: date) -> bool: ...
def __lt__(self, __value: date) -> bool: ...
def __ge__(self, __value: date) -> bool: ...
def __gt__(self, __value: date) -> bool: ...
def __eq__(self, __value: object) -> bool: ...
def __add__(self, __value: timedelta) -> Self: ...
def __radd__(self, __value: timedelta) -> Self: ...
def __le__(self, value: date, /) -> bool: ...
def __lt__(self, value: date, /) -> bool: ...
def __ge__(self, value: date, /) -> bool: ...
def __gt__(self, value: date, /) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
def __add__(self, value: timedelta, /) -> Self: ...
def __radd__(self, value: timedelta, /) -> Self: ...
@overload
def __sub__(self, __value: datetime) -> NoReturn: ...
def __sub__(self, value: datetime, /) -> NoReturn: ...
@overload
def __sub__(self, __value: Self) -> timedelta: ...
def __sub__(self, value: Self, /) -> timedelta: ...
@overload
def __sub__(self, __value: timedelta) -> Self: ...
def __sub__(self, value: timedelta, /) -> Self: ...
def __hash__(self) -> int: ...
def weekday(self) -> int: ...
def isoweekday(self) -> int: ...
@@ -127,24 +127,24 @@ class time:
def tzinfo(self) -> _TzInfo | None: ...
@property
def fold(self) -> int: ...
def __le__(self, __value: time) -> bool: ...
def __lt__(self, __value: time) -> bool: ...
def __ge__(self, __value: time) -> bool: ...
def __gt__(self, __value: time) -> bool: ...
def __eq__(self, __value: object) -> bool: ...
def __le__(self, value: time, /) -> bool: ...
def __lt__(self, value: time, /) -> bool: ...
def __ge__(self, value: time, /) -> bool: ...
def __gt__(self, value: time, /) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
def isoformat(self, timespec: str = ...) -> str: ...
@classmethod
def fromisoformat(cls, __time_string: str) -> Self: ...
def fromisoformat(cls, time_string: str, /) -> Self: ...
# On <3.12, the name of the parameter in the pure-Python implementation
# didn't match the name in the C implementation,
# meaning it is only *safe* to pass it as a keyword argument on 3.12+
if sys.version_info >= (3, 12):
def strftime(self, format: str) -> str: ...
else:
def strftime(self, __format: str) -> str: ...
def strftime(self, format: str, /) -> str: ...
def __format__(self, __fmt: str) -> str: ...
def __format__(self, fmt: str, /) -> str: ...
def utcoffset(self) -> timedelta | None: ...
def tzname(self) -> str | None: ...
def dst(self) -> timedelta | None: ...
@@ -183,30 +183,30 @@ class timedelta:
@property
def microseconds(self) -> int: ...
def total_seconds(self) -> float: ...
def __add__(self, __value: timedelta) -> timedelta: ...
def __radd__(self, __value: timedelta) -> timedelta: ...
def __sub__(self, __value: timedelta) -> timedelta: ...
def __rsub__(self, __value: timedelta) -> timedelta: ...
def __add__(self, value: timedelta, /) -> timedelta: ...
def __radd__(self, value: timedelta, /) -> timedelta: ...
def __sub__(self, value: timedelta, /) -> timedelta: ...
def __rsub__(self, value: timedelta, /) -> timedelta: ...
def __neg__(self) -> timedelta: ...
def __pos__(self) -> timedelta: ...
def __abs__(self) -> timedelta: ...
def __mul__(self, __value: float) -> timedelta: ...
def __rmul__(self, __value: float) -> timedelta: ...
def __mul__(self, value: float, /) -> timedelta: ...
def __rmul__(self, value: float, /) -> timedelta: ...
@overload
def __floordiv__(self, __value: timedelta) -> int: ...
def __floordiv__(self, value: timedelta, /) -> int: ...
@overload
def __floordiv__(self, __value: int) -> timedelta: ...
def __floordiv__(self, value: int, /) -> timedelta: ...
@overload
def __truediv__(self, __value: timedelta) -> float: ...
def __truediv__(self, value: timedelta, /) -> float: ...
@overload
def __truediv__(self, __value: float) -> timedelta: ...
def __mod__(self, __value: timedelta) -> timedelta: ...
def __divmod__(self, __value: timedelta) -> tuple[int, timedelta]: ...
def __le__(self, __value: timedelta) -> bool: ...
def __lt__(self, __value: timedelta) -> bool: ...
def __ge__(self, __value: timedelta) -> bool: ...
def __gt__(self, __value: timedelta) -> bool: ...
def __eq__(self, __value: object) -> bool: ...
def __truediv__(self, value: float, /) -> timedelta: ...
def __mod__(self, value: timedelta, /) -> timedelta: ...
def __divmod__(self, value: timedelta, /) -> tuple[int, timedelta]: ...
def __le__(self, value: timedelta, /) -> bool: ...
def __lt__(self, value: timedelta, /) -> bool: ...
def __ge__(self, value: timedelta, /) -> bool: ...
def __gt__(self, value: timedelta, /) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
def __bool__(self) -> bool: ...
def __hash__(self) -> int: ...
@@ -246,11 +246,11 @@ class datetime(date):
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ...
else:
@classmethod
def fromtimestamp(cls, __timestamp: float, tz: _TzInfo | None = ...) -> Self: ...
def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = ...) -> Self: ...
@classmethod
@deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.UTC)")
def utcfromtimestamp(cls, __t: float) -> Self: ...
def utcfromtimestamp(cls, t: float, /) -> Self: ...
@classmethod
def now(cls, tz: _TzInfo | None = None) -> Self: ...
@classmethod
@@ -279,17 +279,17 @@ class datetime(date):
def astimezone(self, tz: _TzInfo | None = ...) -> Self: ...
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
@classmethod
def strptime(cls, __date_string: str, __format: str) -> Self: ...
def strptime(cls, date_string: str, format: str, /) -> Self: ...
def utcoffset(self) -> timedelta | None: ...
def tzname(self) -> str | None: ...
def dst(self) -> timedelta | None: ...
def __le__(self, __value: datetime) -> bool: ... # type: ignore[override]
def __lt__(self, __value: datetime) -> bool: ... # type: ignore[override]
def __ge__(self, __value: datetime) -> bool: ... # type: ignore[override]
def __gt__(self, __value: datetime) -> bool: ... # type: ignore[override]
def __eq__(self, __value: object) -> bool: ...
def __le__(self, value: datetime, /) -> bool: ... # type: ignore[override]
def __lt__(self, value: datetime, /) -> bool: ... # type: ignore[override]
def __ge__(self, value: datetime, /) -> bool: ... # type: ignore[override]
def __gt__(self, value: datetime, /) -> bool: ... # type: ignore[override]
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
@overload # type: ignore[override]
def __sub__(self, __value: Self) -> timedelta: ...
def __sub__(self, value: Self, /) -> timedelta: ...
@overload
def __sub__(self, __value: timedelta) -> Self: ...
def __sub__(self, value: timedelta, /) -> Self: ...

View File

@@ -38,4 +38,4 @@ if sys.platform != "win32":
__new__: None # type: ignore[assignment]
__init__: None # type: ignore[assignment]
def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _gdbm: ...
def open(filename: str, flags: str = "r", mode: int = 0o666, /) -> _gdbm: ...

View File

@@ -34,4 +34,4 @@ if sys.platform != "win32":
__new__: None # type: ignore[assignment]
__init__: None # type: ignore[assignment]
def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _dbm: ...
def open(filename: str, flags: str = "r", mode: int = 0o666, /) -> _dbm: ...

View File

@@ -25,7 +25,7 @@ class Charset:
@overload
def body_encode(self, string: str | bytes) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, __value: object) -> bool: ...
def __ne__(self, value: object, /) -> bool: ...
def add_charset(
charset: str, header_enc: int | None = None, body_enc: int | None = None, output_charset: str | None = None

View File

@@ -17,7 +17,7 @@ class Header:
def append(self, s: bytes | bytearray | str, charset: Charset | str | None = None, errors: str = "strict") -> None: ...
def encode(self, splitchars: str = ";, \t", maxlinelen: int | None = None, linesep: str = "\n") -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, __value: object) -> bool: ...
def __ne__(self, value: object, /) -> bool: ...
# decode_header() either returns list[tuple[str, None]] if the header
# contains no encoded parts, or list[tuple[bytes, str | None]] if the header

View File

@@ -140,9 +140,9 @@ class MessageIDHeader:
class _HeaderParser(Protocol):
max_count: ClassVar[Literal[1] | None]
@staticmethod
def value_parser(__value: str) -> TokenList: ...
def value_parser(value: str, /) -> TokenList: ...
@classmethod
def parse(cls, __value: str, __kwds: dict[str, Any]) -> None: ...
def parse(cls, value: str, kwds: dict[str, Any], /) -> None: ...
class HeaderRegistry:
registry: dict[str, type[_HeaderParser]]

View File

@@ -20,10 +20,10 @@ _HeaderType: TypeAlias = Any
_HeaderTypeParam: TypeAlias = str | Header
class _SupportsEncodeToPayload(Protocol):
def encode(self, __encoding: str) -> _PayloadType | _MultipartPayloadType | _SupportsDecodeToPayload: ...
def encode(self, encoding: str, /) -> _PayloadType | _MultipartPayloadType | _SupportsDecodeToPayload: ...
class _SupportsDecodeToPayload(Protocol):
def decode(self, __encoding: str, __errors: str) -> _PayloadType | _MultipartPayloadType: ...
def decode(self, encoding: str, errors: str, /) -> _PayloadType | _MultipartPayloadType: ...
class Message:
policy: Policy # undocumented

View File

@@ -6,16 +6,16 @@ class IncrementalEncoder(codecs.IncrementalEncoder):
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
@staticmethod
def _buffer_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
class StreamWriter(codecs.StreamWriter):
@staticmethod
def encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
class StreamReader(codecs.StreamReader):
@staticmethod
def decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def getregentry() -> codecs.CodecInfo: ...
def encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ...

View File

@@ -106,22 +106,22 @@ if sys.platform != "win32":
FICLONERANGE: int
@overload
def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: int = 0) -> int: ...
def fcntl(fd: FileDescriptorLike, cmd: int, arg: int = 0, /) -> int: ...
@overload
def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: str | ReadOnlyBuffer) -> bytes: ...
def fcntl(fd: FileDescriptorLike, cmd: int, arg: str | ReadOnlyBuffer, /) -> bytes: ...
# If arg is an int, return int
@overload
def ioctl(__fd: FileDescriptorLike, __request: int, __arg: int = 0, __mutate_flag: bool = True) -> int: ...
def ioctl(fd: FileDescriptorLike, request: int, arg: int = 0, mutate_flag: bool = True, /) -> int: ...
# The return type works as follows:
# - If arg is a read-write buffer, return int if mutate_flag is True, otherwise bytes
# - If arg is a read-only buffer, return bytes (and ignore the value of mutate_flag)
# We can't represent that precisely as we can't distinguish between read-write and read-only
# buffers, so we add overloads for a few unambiguous cases and use Any for the rest.
@overload
def ioctl(__fd: FileDescriptorLike, __request: int, __arg: bytes, __mutate_flag: bool = True) -> bytes: ...
def ioctl(fd: FileDescriptorLike, request: int, arg: bytes, mutate_flag: bool = True, /) -> bytes: ...
@overload
def ioctl(__fd: FileDescriptorLike, __request: int, __arg: WriteableBuffer, __mutate_flag: Literal[False]) -> bytes: ...
def ioctl(fd: FileDescriptorLike, request: int, arg: WriteableBuffer, mutate_flag: Literal[False], /) -> bytes: ...
@overload
def ioctl(__fd: FileDescriptorLike, __request: int, __arg: Buffer, __mutate_flag: bool = True) -> Any: ...
def flock(__fd: FileDescriptorLike, __operation: int) -> None: ...
def lockf(__fd: FileDescriptorLike, __cmd: int, __len: int = 0, __start: int = 0, __whence: int = 0) -> Any: ...
def ioctl(fd: FileDescriptorLike, request: int, arg: Buffer, mutate_flag: bool = True, /) -> Any: ...
def flock(fd: FileDescriptorLike, operation: int, /) -> None: ...
def lockf(fd: FileDescriptorLike, cmd: int, len: int = 0, start: int = 0, whence: int = 0, /) -> Any: ...

View File

@@ -24,7 +24,7 @@ class Fraction(Rational):
@overload
def __new__(cls, numerator: int | Rational = 0, denominator: int | Rational | None = None) -> Self: ...
@overload
def __new__(cls, __value: float | Decimal | str) -> Self: ...
def __new__(cls, value: float | Decimal | str, /) -> Self: ...
@classmethod
def from_float(cls, f: float) -> Self: ...
@classmethod

View File

@@ -36,9 +36,9 @@ _PWrapper = ParamSpec("_PWrapper")
_RWrapper = TypeVar("_RWrapper")
@overload
def reduce(__function: Callable[[_T, _S], _T], __sequence: Iterable[_S], __initial: _T) -> _T: ...
def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T, /) -> _T: ...
@overload
def reduce(__function: Callable[[_T, _T], _T], __sequence: Iterable[_T]) -> _T: ...
def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T], /) -> _T: ...
class _CacheInfo(NamedTuple):
hits: int
@@ -61,7 +61,7 @@ class _lru_cache_wrapper(Generic[_T]):
def cache_parameters(self) -> _CacheParameters: ...
def __copy__(self) -> _lru_cache_wrapper[_T]: ...
def __deepcopy__(self, __memo: Any) -> _lru_cache_wrapper[_T]: ...
def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T]: ...
@overload
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
@@ -129,8 +129,8 @@ class partial(Generic[_T]):
def args(self) -> tuple[Any, ...]: ...
@property
def keywords(self) -> dict[str, Any]: ...
def __new__(cls, __func: Callable[..., _T], *args: Any, **kwargs: Any) -> Self: ...
def __call__(__self, *args: Any, **kwargs: Any) -> _T: ...
def __new__(cls, func: Callable[..., _T], /, *args: Any, **kwargs: Any) -> Self: ...
def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -142,9 +142,9 @@ class partialmethod(Generic[_T]):
args: tuple[Any, ...]
keywords: dict[str, Any]
@overload
def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
def __init__(self, func: Callable[..., _T], /, *args: Any, **keywords: Any) -> None: ...
@overload
def __init__(self, __func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
def __init__(self, func: _Descriptor, /, *args: Any, **keywords: Any) -> None: ...
def __get__(self, obj: Any, cls: type[Any] | None = None) -> Callable[..., _T]: ...
@property
def __isabstractmethod__(self) -> bool: ...
@@ -166,7 +166,7 @@ class _SingleDispatchCallable(Generic[_T]):
@overload
def register(self, cls: type[Any], func: Callable[..., _T]) -> Callable[..., _T]: ...
def _clear_cache(self) -> None: ...
def __call__(__self, *args: Any, **kwargs: Any) -> _T: ...
def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ...
def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ...
@@ -199,7 +199,7 @@ class cached_property(Generic[_T_co]):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
if sys.version_info >= (3, 9):
def cache(__user_function: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...
def cache(user_function: Callable[..., _T], /) -> _lru_cache_wrapper[_T]: ...
def _make_key(
args: tuple[Hashable, ...],

View File

@@ -27,11 +27,11 @@ def get_referents(*objs: Any) -> list[Any]: ...
def get_referrers(*objs: Any) -> list[Any]: ...
def get_stats() -> list[dict[str, Any]]: ...
def get_threshold() -> tuple[int, int, int]: ...
def is_tracked(__obj: Any) -> bool: ...
def is_tracked(obj: Any, /) -> bool: ...
if sys.version_info >= (3, 9):
def is_finalized(__obj: Any) -> bool: ...
def is_finalized(obj: Any, /) -> bool: ...
def isenabled() -> bool: ...
def set_debug(__flags: int) -> None: ...
def set_debug(flags: int, /) -> None: ...
def set_threshold(threshold0: int, threshold1: int = ..., threshold2: int = ...) -> None: ...

View File

@@ -22,15 +22,15 @@ FNAME: int # actually Literal[8] # undocumented
FCOMMENT: int # actually Literal[16] # undocumented
class _ReadableFileobj(Protocol):
def read(self, __n: int) -> bytes: ...
def seek(self, __n: int) -> object: ...
def read(self, n: int, /) -> bytes: ...
def seek(self, n: int, /) -> object: ...
# The following attributes and methods are optional:
# name: str
# mode: str
# def fileno() -> int: ...
class _WritableFileobj(Protocol):
def write(self, __b: bytes) -> object: ...
def write(self, b: bytes, /) -> object: ...
def flush(self) -> object: ...
# The following attributes and methods are optional:
# name: str

View File

@@ -59,7 +59,7 @@ class _Hash:
def copy(self) -> Self: ...
def digest(self) -> bytes: ...
def hexdigest(self) -> str: ...
def update(self, __data: ReadableBuffer) -> None: ...
def update(self, data: ReadableBuffer, /) -> None: ...
if sys.version_info >= (3, 9):
def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = ...) -> _Hash: ...
@@ -92,9 +92,9 @@ class _VarLenHash:
name: str
def __init__(self, data: ReadableBuffer = ...) -> None: ...
def copy(self) -> _VarLenHash: ...
def digest(self, __length: int) -> bytes: ...
def hexdigest(self, __length: int) -> str: ...
def update(self, __data: ReadableBuffer) -> None: ...
def digest(self, length: int, /) -> bytes: ...
def hexdigest(self, length: int, /) -> str: ...
def update(self, data: ReadableBuffer, /) -> None: ...
sha3_224 = _Hash
sha3_256 = _Hash
@@ -116,7 +116,8 @@ class _BlakeHash(_Hash):
if sys.version_info >= (3, 9):
def __init__(
self,
__data: ReadableBuffer = ...,
data: ReadableBuffer = ...,
/,
*,
digest_size: int = ...,
key: ReadableBuffer = ...,
@@ -134,7 +135,8 @@ class _BlakeHash(_Hash):
else:
def __init__(
self,
__data: ReadableBuffer = ...,
data: ReadableBuffer = ...,
/,
*,
digest_size: int = ...,
key: ReadableBuffer = ...,
@@ -157,9 +159,9 @@ if sys.version_info >= (3, 11):
def getbuffer(self) -> ReadableBuffer: ...
class _FileDigestFileObj(Protocol):
def readinto(self, __buf: bytearray) -> int: ...
def readinto(self, buf: bytearray, /) -> int: ...
def readable(self) -> bool: ...
def file_digest(
__fileobj: _BytesIOLike | _FileDigestFileObj, __digest: str | Callable[[], _Hash], *, _bufsize: int = 262144
fileobj: _BytesIOLike | _FileDigestFileObj, digest: str | Callable[[], _Hash], /, *, _bufsize: int = 262144
) -> _Hash: ...

View File

@@ -14,4 +14,4 @@ def merge(
) -> Iterable[_S]: ...
def nlargest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ...
def nsmallest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ...
def _heapify_max(__heap: list[Any]) -> None: ... # undocumented
def _heapify_max(heap: list[Any], /) -> None: ... # undocumented

View File

@@ -32,7 +32,7 @@ class HMAC:
def copy(self) -> HMAC: ...
@overload
def compare_digest(__a: ReadableBuffer, __b: ReadableBuffer) -> bool: ...
def compare_digest(a: ReadableBuffer, b: ReadableBuffer, /) -> bool: ...
@overload
def compare_digest(__a: AnyStr, __b: AnyStr) -> bool: ...
def compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ...
def digest(key: SizedBuffer, msg: ReadableBuffer, digest: _DigestMod) -> bytes: ...

View File

@@ -6,8 +6,8 @@ __all__ = ["what"]
class _ReadableBinary(Protocol):
def tell(self) -> int: ...
def read(self, __size: int) -> bytes: ...
def seek(self, __offset: int) -> Any: ...
def read(self, size: int, /) -> bytes: ...
def seek(self, offset: int, /) -> Any: ...
@overload
def what(file: StrPath | _ReadableBinary, h: None = None) -> str | None: ...

View File

@@ -45,7 +45,7 @@ class _FileLike(Protocol):
def read(self) -> str | bytes: ...
def close(self) -> Any: ...
def __enter__(self) -> Any: ...
def __exit__(self, __typ: type[BaseException] | None, __exc: BaseException | None, __tb: TracebackType | None) -> Any: ...
def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None, /) -> Any: ...
# PathLike doesn't work for the pathname argument here
def load_source(name: str, pathname: str, file: _FileLike | None = None) -> types.ModuleType: ...

View File

@@ -72,7 +72,7 @@ if sys.version_info >= (3, 10):
def invalidate_caches(self) -> None: ...
# Not defined on the actual class, but expected to exist.
def find_spec(
self, __fullname: str, __path: Sequence[str] | None, __target: types.ModuleType | None = ...
self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ..., /
) -> ModuleSpec | None: ...
class PathEntryFinder(metaclass=ABCMeta):
@@ -91,7 +91,7 @@ else:
def invalidate_caches(self) -> None: ...
# Not defined on the actual class, but expected to exist.
def find_spec(
self, __fullname: str, __path: Sequence[str] | None, __target: types.ModuleType | None = ...
self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ..., /
) -> ModuleSpec | None: ...
class PathEntryFinder(Finder):
@@ -138,25 +138,25 @@ if sys.version_info >= (3, 9):
def joinpath(self, *descendants: str) -> Traversable: ...
else:
@abstractmethod
def joinpath(self, __child: str) -> Traversable: ...
def joinpath(self, child: str, /) -> Traversable: ...
# The documentation and runtime protocol allows *args, **kwargs arguments,
# but this would mean that all implementers would have to support them,
# which is not the case.
@overload
@abstractmethod
def open(self, __mode: Literal["r"] = "r", *, encoding: str | None = None, errors: str | None = None) -> IO[str]: ...
def open(self, mode: Literal["r"] = "r", /, *, encoding: str | None = None, errors: str | None = None) -> IO[str]: ...
@overload
@abstractmethod
def open(self, __mode: Literal["rb"]) -> IO[bytes]: ...
def open(self, mode: Literal["rb"], /) -> IO[bytes]: ...
@property
@abstractmethod
def name(self) -> str: ...
if sys.version_info >= (3, 10):
def __truediv__(self, __child: str) -> Traversable: ...
def __truediv__(self, child: str, /) -> Traversable: ...
else:
@abstractmethod
def __truediv__(self, __child: str) -> Traversable: ...
def __truediv__(self, child: str, /) -> Traversable: ...
@abstractmethod
def read_bytes(self) -> bytes: ...

View File

@@ -225,10 +225,10 @@ def isasyncgenfunction(obj: Callable[_P, Any]) -> TypeGuard[Callable[_P, AsyncGe
def isasyncgenfunction(obj: object) -> TypeGuard[Callable[..., AsyncGeneratorType[Any, Any]]]: ...
class _SupportsSet(Protocol[_T_cont, _V_cont]):
def __set__(self, __instance: _T_cont, __value: _V_cont) -> None: ...
def __set__(self, instance: _T_cont, value: _V_cont, /) -> None: ...
class _SupportsDelete(Protocol[_T_cont]):
def __delete__(self, __instance: _T_cont) -> None: ...
def __delete__(self, instance: _T_cont, /) -> None: ...
def isasyncgen(object: object) -> TypeGuard[AsyncGeneratorType[Any, Any]]: ...
def istraceback(object: object) -> TypeGuard[TracebackType]: ...
@@ -482,7 +482,7 @@ def formatargvalues(
formatvalue: Callable[[Any], str] | None = ...,
) -> str: ...
def getmro(cls: type) -> tuple[type, ...]: ...
def getcallargs(__func: Callable[_P, Any], *args: _P.args, **kwds: _P.kwargs) -> dict[str, Any]: ...
def getcallargs(func: Callable[_P, Any], /, *args: _P.args, **kwds: _P.kwargs) -> dict[str, Any]: ...
class ClosureVars(NamedTuple):
nonlocals: Mapping[str, Any]

View File

@@ -63,15 +63,15 @@ class IOBase(metaclass=abc.ABCMeta):
def isatty(self) -> bool: ...
def readable(self) -> bool: ...
read: Callable[..., Any]
def readlines(self, __hint: int = -1) -> list[bytes]: ...
def seek(self, __offset: int, __whence: int = ...) -> int: ...
def readlines(self, hint: int = -1, /) -> list[bytes]: ...
def seek(self, offset: int, whence: int = ..., /) -> int: ...
def seekable(self) -> bool: ...
def tell(self) -> int: ...
def truncate(self, __size: int | None = ...) -> int: ...
def truncate(self, size: int | None = ..., /) -> int: ...
def writable(self) -> bool: ...
write: Callable[..., Any]
def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ...
def readline(self, __size: int | None = -1) -> bytes: ...
def writelines(self, lines: Iterable[ReadableBuffer], /) -> None: ...
def readline(self, size: int | None = -1, /) -> bytes: ...
def __del__(self) -> None: ...
@property
def closed(self) -> bool: ...
@@ -79,18 +79,18 @@ class IOBase(metaclass=abc.ABCMeta):
class RawIOBase(IOBase):
def readall(self) -> bytes: ...
def readinto(self, __buffer: WriteableBuffer) -> int | None: ...
def write(self, __b: ReadableBuffer) -> int | None: ...
def read(self, __size: int = -1) -> bytes | None: ...
def readinto(self, buffer: WriteableBuffer, /) -> int | None: ...
def write(self, b: ReadableBuffer, /) -> int | None: ...
def read(self, size: int = -1, /) -> bytes | None: ...
class BufferedIOBase(IOBase):
raw: RawIOBase # This is not part of the BufferedIOBase API and may not exist on some implementations.
def detach(self) -> RawIOBase: ...
def readinto(self, __buffer: WriteableBuffer) -> int: ...
def write(self, __buffer: ReadableBuffer) -> int: ...
def readinto1(self, __buffer: WriteableBuffer) -> int: ...
def read(self, __size: int | None = ...) -> bytes: ...
def read1(self, __size: int = ...) -> bytes: ...
def readinto(self, buffer: WriteableBuffer, /) -> int: ...
def write(self, buffer: ReadableBuffer, /) -> int: ...
def readinto1(self, buffer: WriteableBuffer, /) -> int: ...
def read(self, size: int | None = ..., /) -> bytes: ...
def read1(self, size: int = ..., /) -> bytes: ...
class FileIO(RawIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes
mode: str
@@ -103,8 +103,8 @@ class FileIO(RawIOBase, BinaryIO): # type: ignore[misc] # incompatible definit
) -> None: ...
@property
def closefd(self) -> bool: ...
def write(self, __b: ReadableBuffer) -> int: ...
def read(self, __size: int = -1) -> bytes: ...
def write(self, b: ReadableBuffer, /) -> int: ...
def read(self, size: int = -1, /) -> bytes: ...
def __enter__(self) -> Self: ...
class BytesIO(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
@@ -116,25 +116,25 @@ class BytesIO(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible d
def __enter__(self) -> Self: ...
def getvalue(self) -> bytes: ...
def getbuffer(self) -> memoryview: ...
def read1(self, __size: int | None = -1) -> bytes: ...
def read1(self, size: int | None = -1, /) -> bytes: ...
class BufferedReader(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
def __enter__(self) -> Self: ...
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
def peek(self, __size: int = 0) -> bytes: ...
def peek(self, size: int = 0, /) -> bytes: ...
class BufferedWriter(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes
def __enter__(self) -> Self: ...
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
def write(self, __buffer: ReadableBuffer) -> int: ...
def write(self, buffer: ReadableBuffer, /) -> int: ...
class BufferedRandom(BufferedReader, BufferedWriter): # type: ignore[misc] # incompatible definitions of methods in the base classes
def __enter__(self) -> Self: ...
def seek(self, __target: int, __whence: int = 0) -> int: ... # stubtest needs this
def seek(self, target: int, whence: int = 0, /) -> int: ... # stubtest needs this
class BufferedRWPair(BufferedIOBase):
def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = ...) -> None: ...
def peek(self, __size: int = ...) -> bytes: ...
def peek(self, size: int = ..., /) -> bytes: ...
class TextIOBase(IOBase):
encoding: str
@@ -143,11 +143,11 @@ class TextIOBase(IOBase):
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
def __next__(self) -> str: ... # type: ignore[override]
def detach(self) -> BinaryIO: ...
def write(self, __s: str) -> int: ...
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override]
def readline(self, __size: int = ...) -> str: ... # type: ignore[override]
def readlines(self, __hint: int = -1) -> list[str]: ... # type: ignore[override]
def read(self, __size: int | None = ...) -> str: ...
def write(self, s: str, /) -> int: ...
def writelines(self, lines: Iterable[str], /) -> None: ... # type: ignore[override]
def readline(self, size: int = ..., /) -> str: ... # type: ignore[override]
def readlines(self, hint: int = -1, /) -> list[str]: ... # type: ignore[override]
def read(self, size: int | None = ..., /) -> str: ...
@type_check_only
class _WrappedBuffer(Protocol):
@@ -207,14 +207,14 @@ class TextIOWrapper(TextIOBase, TextIO): # type: ignore[misc] # incompatible d
def __enter__(self) -> Self: ...
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
def __next__(self) -> str: ... # type: ignore[override]
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override]
def readline(self, __size: int = -1) -> str: ... # type: ignore[override]
def readlines(self, __hint: int = -1) -> list[str]: ... # type: ignore[override]
def writelines(self, lines: Iterable[str], /) -> None: ... # type: ignore[override]
def readline(self, size: int = -1, /) -> str: ... # type: ignore[override]
def readlines(self, hint: int = -1, /) -> list[str]: ... # type: ignore[override]
# Equals the "buffer" argument passed in to the constructor.
def detach(self) -> BinaryIO: ...
# TextIOWrapper's version of seek only supports a limited subset of
# operations.
def seek(self, __cookie: int, __whence: int = 0) -> int: ...
def seek(self, cookie: int, whence: int = 0, /) -> int: ...
class StringIO(TextIOWrapper):
def __init__(self, initial_value: str | None = ..., newline: str | None = ...) -> None: ...
@@ -229,10 +229,10 @@ class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer | str, final: bool = False) -> str: ...
@property
def newlines(self) -> str | tuple[str, ...] | None: ...
def setstate(self, __state: tuple[bytes, int]) -> None: ...
def setstate(self, state: tuple[bytes, int], /) -> None: ...
if sys.version_info >= (3, 10):
@overload
def text_encoding(__encoding: None, __stacklevel: int = 2) -> Literal["locale", "utf-8"]: ...
def text_encoding(encoding: None, stacklevel: int = 2, /) -> Literal["locale", "utf-8"]: ...
@overload
def text_encoding(__encoding: _T, __stacklevel: int = 2) -> _T: ...
def text_encoding(encoding: _T, stacklevel: int = 2, /) -> _T: ...

View File

@@ -35,7 +35,7 @@ class count(Iterator[_N]):
def __iter__(self) -> Self: ...
class cycle(Iterator[_T]):
def __init__(self, __iterable: Iterable[_T]) -> None: ...
def __init__(self, iterable: Iterable[_T], /) -> None: ...
def __next__(self) -> _T: ...
def __iter__(self) -> Self: ...
@@ -62,9 +62,9 @@ class chain(Iterator[_T]):
def __iter__(self) -> Self: ...
@classmethod
# We use type[Any] and not type[_S] to not lose the type inference from __iterable
def from_iterable(cls: type[Any], __iterable: Iterable[Iterable[_S]]) -> chain[_S]: ...
def from_iterable(cls: type[Any], iterable: Iterable[Iterable[_S]], /) -> chain[_S]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class compress(Iterator[_T]):
def __init__(self, data: Iterable[_T], selectors: Iterable[Any]) -> None: ...
@@ -72,12 +72,12 @@ class compress(Iterator[_T]):
def __next__(self) -> _T: ...
class dropwhile(Iterator[_T]):
def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ...
def __init__(self, predicate: _Predicate[_T], iterable: Iterable[_T], /) -> None: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...
class filterfalse(Iterator[_T]):
def __init__(self, __predicate: _Predicate[_T] | None, __iterable: Iterable[_T]) -> None: ...
def __init__(self, predicate: _Predicate[_T] | None, iterable: Iterable[_T], /) -> None: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...
@@ -91,74 +91,70 @@ class groupby(Iterator[tuple[_T_co, Iterator[_S_co]]], Generic[_T_co, _S_co]):
class islice(Iterator[_T]):
@overload
def __init__(self, __iterable: Iterable[_T], __stop: int | None) -> None: ...
def __init__(self, iterable: Iterable[_T], stop: int | None, /) -> None: ...
@overload
def __init__(self, __iterable: Iterable[_T], __start: int | None, __stop: int | None, __step: int | None = ...) -> None: ...
def __init__(self, iterable: Iterable[_T], start: int | None, stop: int | None, step: int | None = ..., /) -> None: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...
class starmap(Iterator[_T_co]):
def __new__(cls, __function: Callable[..., _T], __iterable: Iterable[Iterable[Any]]) -> starmap[_T]: ...
def __new__(cls, function: Callable[..., _T], iterable: Iterable[Iterable[Any]], /) -> starmap[_T]: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T_co: ...
class takewhile(Iterator[_T]):
def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ...
def __init__(self, predicate: _Predicate[_T], iterable: Iterable[_T], /) -> None: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...
def tee(__iterable: Iterable[_T], __n: int = 2) -> tuple[Iterator[_T], ...]: ...
def tee(iterable: Iterable[_T], n: int = 2, /) -> tuple[Iterator[_T], ...]: ...
class zip_longest(Iterator[_T_co]):
# one iterable (fillvalue doesn't matter)
@overload
def __new__(cls, __iter1: Iterable[_T1], *, fillvalue: object = ...) -> zip_longest[tuple[_T1]]: ...
def __new__(cls, iter1: Iterable[_T1], /, *, fillvalue: object = ...) -> zip_longest[tuple[_T1]]: ...
# two iterables
@overload
# In the overloads without fillvalue, all of the tuple members could theoretically be None,
# but we return Any instead to avoid false positives for code where we know one of the iterables
# is longer.
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> zip_longest[tuple[_T1 | Any, _T2 | Any]]: ...
def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /) -> zip_longest[tuple[_T1 | Any, _T2 | Any]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], *, fillvalue: _T
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /, *, fillvalue: _T
) -> zip_longest[tuple[_T1 | _T, _T2 | _T]]: ...
# three iterables
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /
) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], *, fillvalue: _T
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /, *, fillvalue: _T
) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T]]: ...
# four iterables
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4]
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /
) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any, _T4 | Any]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4], *, fillvalue: _T
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /, *, fillvalue: _T
) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T, _T4 | _T]]: ...
# five iterables
@overload
def __new__(
cls,
__iter1: Iterable[_T1],
__iter2: Iterable[_T2],
__iter3: Iterable[_T3],
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], /
) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any, _T4 | Any, _T5 | Any]]: ...
@overload
def __new__(
cls,
__iter1: Iterable[_T1],
__iter2: Iterable[_T2],
__iter3: Iterable[_T3],
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
/,
*,
fillvalue: _T,
) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T, _T4 | _T, _T5 | _T]]: ...
@@ -166,23 +162,25 @@ class zip_longest(Iterator[_T_co]):
@overload
def __new__(
cls,
__iter1: Iterable[_T],
__iter2: Iterable[_T],
__iter3: Iterable[_T],
__iter4: Iterable[_T],
__iter5: Iterable[_T],
__iter6: Iterable[_T],
iter1: Iterable[_T],
iter2: Iterable[_T],
iter3: Iterable[_T],
iter4: Iterable[_T],
iter5: Iterable[_T],
iter6: Iterable[_T],
/,
*iterables: Iterable[_T],
) -> zip_longest[tuple[_T | Any, ...]]: ...
@overload
def __new__(
cls,
__iter1: Iterable[_T],
__iter2: Iterable[_T],
__iter3: Iterable[_T],
__iter4: Iterable[_T],
__iter5: Iterable[_T],
__iter6: Iterable[_T],
iter1: Iterable[_T],
iter2: Iterable[_T],
iter3: Iterable[_T],
iter4: Iterable[_T],
iter5: Iterable[_T],
iter6: Iterable[_T],
/,
*iterables: Iterable[_T],
fillvalue: _T,
) -> zip_longest[tuple[_T, ...]]: ...
@@ -191,33 +189,29 @@ class zip_longest(Iterator[_T_co]):
class product(Iterator[_T_co]):
@overload
def __new__(cls, __iter1: Iterable[_T1]) -> product[tuple[_T1]]: ...
def __new__(cls, iter1: Iterable[_T1], /) -> product[tuple[_T1]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> product[tuple[_T1, _T2]]: ...
def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /) -> product[tuple[_T1, _T2]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> product[tuple[_T1, _T2, _T3]]: ...
def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /) -> product[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4]
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /
) -> product[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
__iter1: Iterable[_T1],
__iter2: Iterable[_T2],
__iter3: Iterable[_T3],
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], /
) -> product[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,
__iter1: Iterable[_T1],
__iter2: Iterable[_T2],
__iter3: Iterable[_T3],
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
__iter6: Iterable[_T6],
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
iter6: Iterable[_T6],
/,
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
@overload
def __new__(cls, *iterables: Iterable[_T1], repeat: int = 1) -> product[tuple[_T1, ...]]: ...
@@ -268,7 +262,7 @@ class combinations_with_replacement(Iterator[_T_co]):
if sys.version_info >= (3, 10):
class pairwise(Iterator[_T_co]):
def __new__(cls, __iterable: Iterable[_T]) -> pairwise[tuple[_T, _T]]: ...
def __new__(cls, iterable: Iterable[_T], /) -> pairwise[tuple[_T, _T]]: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T_co: ...

View File

@@ -38,5 +38,5 @@ class BaseFix:
class ConditionalFix(BaseFix, metaclass=ABCMeta):
skip_on: ClassVar[str | None]
def start_tree(self, __tree: Node, __filename: StrPath) -> None: ...
def start_tree(self, tree: Node, filename: StrPath, /) -> None: ...
def should_skip(self, node: Base) -> bool: ...

View File

@@ -71,12 +71,12 @@ _FormatStyle: TypeAlias = Literal["%", "{", "$"]
if sys.version_info >= (3, 12):
class _SupportsFilter(Protocol):
def filter(self, __record: LogRecord) -> bool | LogRecord: ...
def filter(self, record: LogRecord, /) -> bool | LogRecord: ...
_FilterType: TypeAlias = Filter | Callable[[LogRecord], bool | LogRecord] | _SupportsFilter
else:
class _SupportsFilter(Protocol):
def filter(self, __record: LogRecord) -> bool: ...
def filter(self, record: LogRecord, /) -> bool: ...
_FilterType: TypeAlias = Filter | Callable[[LogRecord], bool] | _SupportsFilter
@@ -355,7 +355,7 @@ class LogRecord:
) -> None: ...
def getMessage(self) -> str: ...
# Allows setting contextual information on LogRecord objects as per the docs, see #7833
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __setattr__(self, name: str, value: Any, /) -> None: ...
_L = TypeVar("_L", bound=Logger | LoggerAdapter[Any])

View File

@@ -253,7 +253,7 @@ class HTTPHandler(Handler):
class _QueueLike(Protocol[_T]):
def get(self) -> _T: ...
def put_nowait(self, __item: _T) -> None: ...
def put_nowait(self, item: _T, /) -> None: ...
class QueueHandler(Handler):
queue: _QueueLike[Any]

View File

@@ -99,7 +99,7 @@ class LZMACompressor:
def __init__(
self, format: int | None = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ...
) -> None: ...
def compress(self, __data: ReadableBuffer) -> bytes: ...
def compress(self, data: ReadableBuffer, /) -> bytes: ...
def flush(self) -> bytes: ...
class LZMAError(Exception): ...
@@ -194,4 +194,4 @@ def compress(
def decompress(
data: ReadableBuffer, format: int = 0, memlimit: int | None = None, filters: _FilterChain | None = None
) -> bytes: ...
def is_check_supported(__check_id: int) -> bool: ...
def is_check_supported(check_id: int, /) -> bool: ...

View File

@@ -27,7 +27,7 @@ _Marshallable: TypeAlias = (
| ReadableBuffer
)
def dump(__value: _Marshallable, __file: SupportsWrite[bytes], __version: int = 4) -> None: ...
def load(__file: SupportsRead[bytes]) -> Any: ...
def dumps(__value: _Marshallable, __version: int = 4) -> bytes: ...
def loads(__bytes: ReadableBuffer) -> Any: ...
def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /) -> None: ...
def load(file: SupportsRead[bytes], /) -> Any: ...
def dumps(value: _Marshallable, version: int = 4, /) -> bytes: ...
def loads(bytes: ReadableBuffer, /) -> Any: ...

View File

@@ -14,58 +14,58 @@ inf: float
nan: float
tau: float
def acos(__x: _SupportsFloatOrIndex) -> float: ...
def acosh(__x: _SupportsFloatOrIndex) -> float: ...
def asin(__x: _SupportsFloatOrIndex) -> float: ...
def asinh(__x: _SupportsFloatOrIndex) -> float: ...
def atan(__x: _SupportsFloatOrIndex) -> float: ...
def atan2(__y: _SupportsFloatOrIndex, __x: _SupportsFloatOrIndex) -> float: ...
def atanh(__x: _SupportsFloatOrIndex) -> float: ...
def acos(x: _SupportsFloatOrIndex, /) -> float: ...
def acosh(x: _SupportsFloatOrIndex, /) -> float: ...
def asin(x: _SupportsFloatOrIndex, /) -> float: ...
def asinh(x: _SupportsFloatOrIndex, /) -> float: ...
def atan(x: _SupportsFloatOrIndex, /) -> float: ...
def atan2(y: _SupportsFloatOrIndex, x: _SupportsFloatOrIndex, /) -> float: ...
def atanh(x: _SupportsFloatOrIndex, /) -> float: ...
if sys.version_info >= (3, 11):
def cbrt(__x: _SupportsFloatOrIndex) -> float: ...
def cbrt(x: _SupportsFloatOrIndex, /) -> float: ...
class _SupportsCeil(Protocol[_T_co]):
def __ceil__(self) -> _T_co: ...
@overload
def ceil(__x: _SupportsCeil[_T]) -> _T: ...
def ceil(x: _SupportsCeil[_T], /) -> _T: ...
@overload
def ceil(__x: _SupportsFloatOrIndex) -> int: ...
def comb(__n: SupportsIndex, __k: SupportsIndex) -> int: ...
def copysign(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
def cos(__x: _SupportsFloatOrIndex) -> float: ...
def cosh(__x: _SupportsFloatOrIndex) -> float: ...
def degrees(__x: _SupportsFloatOrIndex) -> float: ...
def dist(__p: Iterable[_SupportsFloatOrIndex], __q: Iterable[_SupportsFloatOrIndex]) -> float: ...
def erf(__x: _SupportsFloatOrIndex) -> float: ...
def erfc(__x: _SupportsFloatOrIndex) -> float: ...
def exp(__x: _SupportsFloatOrIndex) -> float: ...
def ceil(x: _SupportsFloatOrIndex, /) -> int: ...
def comb(n: SupportsIndex, k: SupportsIndex, /) -> int: ...
def copysign(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
def cos(x: _SupportsFloatOrIndex, /) -> float: ...
def cosh(x: _SupportsFloatOrIndex, /) -> float: ...
def degrees(x: _SupportsFloatOrIndex, /) -> float: ...
def dist(p: Iterable[_SupportsFloatOrIndex], q: Iterable[_SupportsFloatOrIndex], /) -> float: ...
def erf(x: _SupportsFloatOrIndex, /) -> float: ...
def erfc(x: _SupportsFloatOrIndex, /) -> float: ...
def exp(x: _SupportsFloatOrIndex, /) -> float: ...
if sys.version_info >= (3, 11):
def exp2(__x: _SupportsFloatOrIndex) -> float: ...
def exp2(x: _SupportsFloatOrIndex, /) -> float: ...
def expm1(__x: _SupportsFloatOrIndex) -> float: ...
def fabs(__x: _SupportsFloatOrIndex) -> float: ...
def factorial(__x: SupportsIndex) -> int: ...
def expm1(x: _SupportsFloatOrIndex, /) -> float: ...
def fabs(x: _SupportsFloatOrIndex, /) -> float: ...
def factorial(x: SupportsIndex, /) -> int: ...
class _SupportsFloor(Protocol[_T_co]):
def __floor__(self) -> _T_co: ...
@overload
def floor(__x: _SupportsFloor[_T]) -> _T: ...
def floor(x: _SupportsFloor[_T], /) -> _T: ...
@overload
def floor(__x: _SupportsFloatOrIndex) -> int: ...
def fmod(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
def frexp(__x: _SupportsFloatOrIndex) -> tuple[float, int]: ...
def fsum(__seq: Iterable[_SupportsFloatOrIndex]) -> float: ...
def gamma(__x: _SupportsFloatOrIndex) -> float: ...
def floor(x: _SupportsFloatOrIndex, /) -> int: ...
def fmod(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
def frexp(x: _SupportsFloatOrIndex, /) -> tuple[float, int]: ...
def fsum(seq: Iterable[_SupportsFloatOrIndex], /) -> float: ...
def gamma(x: _SupportsFloatOrIndex, /) -> float: ...
if sys.version_info >= (3, 9):
def gcd(*integers: SupportsIndex) -> int: ...
else:
def gcd(__x: SupportsIndex, __y: SupportsIndex) -> int: ...
def gcd(x: SupportsIndex, y: SupportsIndex, /) -> int: ...
def hypot(*coordinates: _SupportsFloatOrIndex) -> float: ...
def isclose(
@@ -75,51 +75,51 @@ def isclose(
rel_tol: _SupportsFloatOrIndex = 1e-09,
abs_tol: _SupportsFloatOrIndex = 0.0,
) -> bool: ...
def isinf(__x: _SupportsFloatOrIndex) -> bool: ...
def isfinite(__x: _SupportsFloatOrIndex) -> bool: ...
def isnan(__x: _SupportsFloatOrIndex) -> bool: ...
def isqrt(__n: SupportsIndex) -> int: ...
def isinf(x: _SupportsFloatOrIndex, /) -> bool: ...
def isfinite(x: _SupportsFloatOrIndex, /) -> bool: ...
def isnan(x: _SupportsFloatOrIndex, /) -> bool: ...
def isqrt(n: SupportsIndex, /) -> int: ...
if sys.version_info >= (3, 9):
def lcm(*integers: SupportsIndex) -> int: ...
def ldexp(__x: _SupportsFloatOrIndex, __i: int) -> float: ...
def lgamma(__x: _SupportsFloatOrIndex) -> float: ...
def ldexp(x: _SupportsFloatOrIndex, i: int, /) -> float: ...
def lgamma(x: _SupportsFloatOrIndex, /) -> float: ...
def log(x: _SupportsFloatOrIndex, base: _SupportsFloatOrIndex = ...) -> float: ...
def log10(__x: _SupportsFloatOrIndex) -> float: ...
def log1p(__x: _SupportsFloatOrIndex) -> float: ...
def log2(__x: _SupportsFloatOrIndex) -> float: ...
def modf(__x: _SupportsFloatOrIndex) -> tuple[float, float]: ...
def log10(x: _SupportsFloatOrIndex, /) -> float: ...
def log1p(x: _SupportsFloatOrIndex, /) -> float: ...
def log2(x: _SupportsFloatOrIndex, /) -> float: ...
def modf(x: _SupportsFloatOrIndex, /) -> tuple[float, float]: ...
if sys.version_info >= (3, 12):
def nextafter(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex, *, steps: SupportsIndex | None = None) -> float: ...
def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /, *, steps: SupportsIndex | None = None) -> float: ...
elif sys.version_info >= (3, 9):
def nextafter(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
def perm(__n: SupportsIndex, __k: SupportsIndex | None = None) -> int: ...
def pow(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
def perm(n: SupportsIndex, k: SupportsIndex | None = None, /) -> int: ...
def pow(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
@overload
def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = 1) -> int: ... # type: ignore[overload-overlap]
def prod(iterable: Iterable[SupportsIndex], /, *, start: SupportsIndex = 1) -> int: ... # type: ignore[overload-overlap]
@overload
def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = 1) -> float: ...
def radians(__x: _SupportsFloatOrIndex) -> float: ...
def remainder(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
def sin(__x: _SupportsFloatOrIndex) -> float: ...
def sinh(__x: _SupportsFloatOrIndex) -> float: ...
def prod(iterable: Iterable[_SupportsFloatOrIndex], /, *, start: _SupportsFloatOrIndex = 1) -> float: ...
def radians(x: _SupportsFloatOrIndex, /) -> float: ...
def remainder(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
def sin(x: _SupportsFloatOrIndex, /) -> float: ...
def sinh(x: _SupportsFloatOrIndex, /) -> float: ...
if sys.version_info >= (3, 12):
def sumprod(__p: Iterable[float], __q: Iterable[float]) -> float: ...
def sumprod(p: Iterable[float], q: Iterable[float], /) -> float: ...
def sqrt(__x: _SupportsFloatOrIndex) -> float: ...
def tan(__x: _SupportsFloatOrIndex) -> float: ...
def tanh(__x: _SupportsFloatOrIndex) -> float: ...
def sqrt(x: _SupportsFloatOrIndex, /) -> float: ...
def tan(x: _SupportsFloatOrIndex, /) -> float: ...
def tanh(x: _SupportsFloatOrIndex, /) -> float: ...
# Is different from `_typeshed.SupportsTrunc`, which is not generic
class _SupportsTrunc(Protocol[_T_co]):
def __trunc__(self) -> _T_co: ...
def trunc(__x: _SupportsTrunc[_T]) -> _T: ...
def trunc(x: _SupportsTrunc[_T], /) -> _T: ...
if sys.version_info >= (3, 9):
def ulp(__x: _SupportsFloatOrIndex) -> float: ...
def ulp(x: _SupportsFloatOrIndex, /) -> float: ...

View File

@@ -58,24 +58,24 @@ class mmap(Iterable[int], Sized):
def read(self, n: int | None = ...) -> bytes: ...
def write(self, bytes: ReadableBuffer) -> int: ...
@overload
def __getitem__(self, __key: int) -> int: ...
def __getitem__(self, key: int, /) -> int: ...
@overload
def __getitem__(self, __key: slice) -> bytes: ...
def __delitem__(self, __key: int | slice) -> NoReturn: ...
def __getitem__(self, key: slice, /) -> bytes: ...
def __delitem__(self, key: int | slice, /) -> NoReturn: ...
@overload
def __setitem__(self, __key: int, __value: int) -> None: ...
def __setitem__(self, key: int, value: int, /) -> None: ...
@overload
def __setitem__(self, __key: slice, __value: ReadableBuffer) -> None: ...
def __setitem__(self, key: slice, value: ReadableBuffer, /) -> None: ...
# Doesn't actually exist, but the object actually supports "in" because it has __getitem__,
# so we claim that there is also a __contains__ to help type checkers.
def __contains__(self, __o: object) -> bool: ...
def __contains__(self, o: object, /) -> bool: ...
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and __len__,
# so we claim that there is also an __iter__ to help type checkers.
def __iter__(self) -> Iterator[int]: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: Unused) -> None: ...
def __buffer__(self, __flags: int) -> memoryview: ...
def __release_buffer__(self, __buffer: memoryview) -> None: ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
if sys.platform != "win32":
MADV_NORMAL: int

View File

@@ -13,20 +13,20 @@ if sys.platform == "win32":
SEM_NOALIGNMENTFAULTEXCEPT: int
SEM_NOGPFAULTERRORBOX: int
SEM_NOOPENFILEERRORBOX: int
def locking(__fd: int, __mode: int, __nbytes: int) -> None: ...
def setmode(__fd: int, __mode: int) -> int: ...
def open_osfhandle(__handle: int, __flags: int) -> int: ...
def get_osfhandle(__fd: int) -> int: ...
def locking(fd: int, mode: int, nbytes: int, /) -> None: ...
def setmode(fd: int, mode: int, /) -> int: ...
def open_osfhandle(handle: int, flags: int, /) -> int: ...
def get_osfhandle(fd: int, /) -> int: ...
def kbhit() -> bool: ...
def getch() -> bytes: ...
def getwch() -> str: ...
def getche() -> bytes: ...
def getwche() -> str: ...
def putch(__char: bytes | bytearray) -> None: ...
def putwch(__unicode_char: str) -> None: ...
def ungetch(__char: bytes | bytearray) -> None: ...
def ungetwch(__unicode_char: str) -> None: ...
def putch(char: bytes | bytearray, /) -> None: ...
def putwch(unicode_char: str, /) -> None: ...
def ungetch(char: bytes | bytearray, /) -> None: ...
def ungetwch(unicode_char: str, /) -> None: ...
def heapmin() -> None: ...
def SetErrorMode(__mode: int) -> int: ...
def SetErrorMode(mode: int, /) -> int: ...
if sys.version_info >= (3, 10):
def GetErrorMode() -> int: ... # undocumented

View File

@@ -57,8 +57,8 @@ Process = DummyProcess
class Namespace:
def __init__(self, **kwds: Any) -> None: ...
def __getattr__(self, __name: str) -> Any: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __getattr__(self, name: str, /) -> Any: ...
def __setattr__(self, name: str, value: Any, /) -> None: ...
class Value:
_typecode: Any

View File

@@ -22,8 +22,8 @@ _VT = TypeVar("_VT")
class Namespace:
def __init__(self, **kwds: Any) -> None: ...
def __getattr__(self, __name: str) -> Any: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __getattr__(self, name: str, /) -> Any: ...
def __setattr__(self, name: str, value: Any, /) -> None: ...
_Namespace: TypeAlias = Namespace
@@ -63,23 +63,23 @@ class ValueProxy(BaseProxy, Generic[_T]):
class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
__builtins__: ClassVar[dict[str, Any]]
def __len__(self) -> int: ...
def __getitem__(self, __key: _KT) -> _VT: ...
def __setitem__(self, __key: _KT, __value: _VT) -> None: ...
def __delitem__(self, __key: _KT) -> None: ...
def __getitem__(self, key: _KT, /) -> _VT: ...
def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
def __delitem__(self, key: _KT, /) -> None: ...
def __iter__(self) -> Iterator[_KT]: ...
def copy(self) -> dict[_KT, _VT]: ...
@overload # type: ignore[override]
def get(self, __key: _KT) -> _VT | None: ...
def get(self, key: _KT, /) -> _VT | None: ...
@overload
def get(self, __key: _KT, __default: _VT) -> _VT: ...
def get(self, key: _KT, default: _VT, /) -> _VT: ...
@overload
def get(self, __key: _KT, __default: _T) -> _VT | _T: ...
def get(self, key: _KT, default: _T, /) -> _VT | _T: ...
@overload
def pop(self, __key: _KT) -> _VT: ...
def pop(self, key: _KT, /) -> _VT: ...
@overload
def pop(self, __key: _KT, __default: _VT) -> _VT: ...
def pop(self, key: _KT, default: _VT, /) -> _VT: ...
@overload
def pop(self, __key: _KT, __default: _T) -> _VT | _T: ...
def pop(self, key: _KT, default: _T, /) -> _VT | _T: ...
def keys(self) -> list[_KT]: ... # type: ignore[override]
def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override]
def values(self) -> list[_VT]: ... # type: ignore[override]
@@ -87,26 +87,26 @@ class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
class BaseListProxy(BaseProxy, MutableSequence[_T]):
__builtins__: ClassVar[dict[str, Any]]
def __len__(self) -> int: ...
def __add__(self, __x: list[_T]) -> list[_T]: ...
def __delitem__(self, __i: SupportsIndex | slice) -> None: ...
def __add__(self, x: list[_T], /) -> list[_T]: ...
def __delitem__(self, i: SupportsIndex | slice, /) -> None: ...
@overload
def __getitem__(self, __i: SupportsIndex) -> _T: ...
def __getitem__(self, i: SupportsIndex, /) -> _T: ...
@overload
def __getitem__(self, __s: slice) -> list[_T]: ...
def __getitem__(self, s: slice, /) -> list[_T]: ...
@overload
def __setitem__(self, __i: SupportsIndex, __o: _T) -> None: ...
def __setitem__(self, i: SupportsIndex, o: _T, /) -> None: ...
@overload
def __setitem__(self, __s: slice, __o: Iterable[_T]) -> None: ...
def __mul__(self, __n: SupportsIndex) -> list[_T]: ...
def __rmul__(self, __n: SupportsIndex) -> list[_T]: ...
def __setitem__(self, s: slice, o: Iterable[_T], /) -> None: ...
def __mul__(self, n: SupportsIndex, /) -> list[_T]: ...
def __rmul__(self, n: SupportsIndex, /) -> list[_T]: ...
def __reversed__(self) -> Iterator[_T]: ...
def append(self, __object: _T) -> None: ...
def extend(self, __iterable: Iterable[_T]) -> None: ...
def pop(self, __index: SupportsIndex = ...) -> _T: ...
def index(self, __value: _T, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ...
def count(self, __value: _T) -> int: ...
def insert(self, __index: SupportsIndex, __object: _T) -> None: ...
def remove(self, __value: _T) -> None: ...
def append(self, object: _T, /) -> None: ...
def extend(self, iterable: Iterable[_T], /) -> None: ...
def pop(self, index: SupportsIndex = ..., /) -> _T: ...
def index(self, value: _T, start: SupportsIndex = ..., stop: SupportsIndex = ..., /) -> int: ...
def count(self, value: _T, /) -> int: ...
def insert(self, index: SupportsIndex, object: _T, /) -> None: ...
def remove(self, value: _T, /) -> None: ...
# Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison]
# to work around invariance
@overload
@@ -115,8 +115,8 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]):
def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ...
class ListProxy(BaseListProxy[_T]):
def __iadd__(self, __value: Iterable[_T]) -> Self: ... # type: ignore[override]
def __imul__(self, __value: SupportsIndex) -> Self: ... # type: ignore[override]
def __iadd__(self, value: Iterable[_T], /) -> Self: ... # type: ignore[override]
def __imul__(self, value: SupportsIndex, /) -> Self: ... # type: ignore[override]
# Returned by BaseManager.get_server()
class Server:
@@ -186,19 +186,19 @@ class SyncManager(BaseManager):
@overload
def dict(self, **kwargs: _VT) -> DictProxy[str, _VT]: ...
@overload
def dict(self, __map: SupportsKeysAndGetItem[_KT, _VT]) -> DictProxy[_KT, _VT]: ...
def dict(self, map: SupportsKeysAndGetItem[_KT, _VT], /) -> DictProxy[_KT, _VT]: ...
@overload
def dict(self, __map: SupportsKeysAndGetItem[str, _VT], **kwargs: _VT) -> DictProxy[str, _VT]: ...
def dict(self, map: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> DictProxy[str, _VT]: ...
@overload
def dict(self, __iterable: Iterable[tuple[_KT, _VT]]) -> DictProxy[_KT, _VT]: ...
def dict(self, iterable: Iterable[tuple[_KT, _VT]], /) -> DictProxy[_KT, _VT]: ...
@overload
def dict(self, __iterable: Iterable[tuple[str, _VT]], **kwargs: _VT) -> DictProxy[str, _VT]: ...
def dict(self, iterable: Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> DictProxy[str, _VT]: ...
@overload
def dict(self, __iterable: Iterable[list[str]]) -> DictProxy[str, str]: ...
def dict(self, iterable: Iterable[list[str]], /) -> DictProxy[str, str]: ...
@overload
def dict(self, __iterable: Iterable[list[bytes]]) -> DictProxy[bytes, bytes]: ...
def dict(self, iterable: Iterable[list[bytes]], /) -> DictProxy[bytes, bytes]: ...
@overload
def list(self, __sequence: Sequence[_T]) -> ListProxy[_T]: ...
def list(self, sequence: Sequence[_T], /) -> ListProxy[_T]: ...
@overload
def list(self) -> ListProxy[Any]: ...

View File

@@ -23,7 +23,7 @@ class Queue(Generic[_T]):
def join_thread(self) -> None: ...
def cancel_join_thread(self) -> None: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class JoinableQueue(Queue[_T]):
def task_done(self) -> None: ...

View File

@@ -72,7 +72,7 @@ def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = None, ctx: Any
def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ...
class _AcquireFunc(Protocol):
def __call__(self, __block: bool = ..., __timeout: float | None = ...) -> bool: ...
def __call__(self, block: bool = ..., timeout: float | None = ..., /) -> bool: ...
class SynchronizedBase(Generic[_CT]):
acquire: _AcquireFunc
@@ -83,7 +83,7 @@ class SynchronizedBase(Generic[_CT]):
def get_lock(self) -> _LockLike: ...
def __enter__(self) -> bool: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, /
) -> None: ...
class Synchronized(SynchronizedBase[_SimpleCData[_T]], Generic[_T]):

View File

@@ -23,7 +23,7 @@ class Condition(AbstractContextManager[bool]):
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
def release(self) -> None: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, /
) -> None: ...
class Event:
@@ -38,7 +38,7 @@ class SemLock(AbstractContextManager[bool]):
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
def release(self) -> None: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, /
) -> None: ...
class Lock(SemLock):

View File

@@ -97,11 +97,11 @@ altsep: LiteralString
# but must be defined as pos-only in the stub or cross-platform code doesn't type-check,
# as the parameter name is different in posixpath.join()
@overload
def join(__path: LiteralString, *paths: LiteralString) -> LiteralString: ...
def join(path: LiteralString, /, *paths: LiteralString) -> LiteralString: ...
@overload
def join(__path: StrPath, *paths: StrPath) -> str: ...
def join(path: StrPath, /, *paths: StrPath) -> str: ...
@overload
def join(__path: BytesPath, *paths: BytesPath) -> bytes: ...
def join(path: BytesPath, /, *paths: BytesPath) -> bytes: ...
if sys.platform == "win32":
if sys.version_info >= (3, 10):

View File

@@ -56,4 +56,4 @@ opmap: dict[str, int]
HAVE_ARGUMENT: Literal[90]
EXTENDED_ARG: Literal[144]
def stack_effect(__opcode: int, __oparg: int | None = None, *, jump: bool | None = None) -> int: ...
def stack_effect(opcode: int, oparg: int | None = None, /, *, jump: bool | None = None) -> int: ...

View File

@@ -180,7 +180,7 @@ class Values:
def read_file(self, filename: str, mode: str = "careful") -> None: ...
def read_module(self, modname: str, mode: str = "careful") -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __setattr__(self, name: str, value: Any, /) -> None: ...
def __eq__(self, other: object) -> bool: ...
class OptionParser(OptionContainer):
@@ -222,7 +222,7 @@ class OptionParser(OptionContainer):
def _process_long_opt(self, rargs: list[Any], values: Any) -> None: ...
def _process_short_opts(self, rargs: list[Any], values: Any) -> None: ...
@overload
def add_option_group(self, __opt_group: OptionGroup) -> OptionGroup: ...
def add_option_group(self, opt_group: OptionGroup, /) -> OptionGroup: ...
@overload
def add_option_group(self, *args: Any, **kwargs: Any) -> OptionGroup: ...
def check_values(self, values: Values, args: list[str]) -> tuple[Values, list[str]]: ...

View File

@@ -493,8 +493,8 @@ def get_exec_path(env: Mapping[str, str] | None = None) -> list[str]: ...
def getlogin() -> str: ...
def getpid() -> int: ...
def getppid() -> int: ...
def strerror(__code: int) -> str: ...
def umask(__mask: int) -> int: ...
def strerror(code: int, /) -> str: ...
def umask(mask: int, /) -> int: ...
@final
class uname_result(structseq[str], tuple[str, str, str, str, str]):
if sys.version_info >= (3, 10):
@@ -516,9 +516,9 @@ if sys.platform != "win32":
def getegid() -> int: ...
def geteuid() -> int: ...
def getgid() -> int: ...
def getgrouplist(__user: str, __group: int) -> list[int]: ...
def getgrouplist(user: str, group: int, /) -> list[int]: ...
def getgroups() -> list[int]: ... # Unix only, behaves differently on Mac
def initgroups(__username: str, __gid: int) -> None: ...
def initgroups(username: str, gid: int, /) -> None: ...
def getpgid(pid: int) -> int: ...
def getpgrp() -> int: ...
def getpriority(which: int, who: int) -> int: ...
@@ -528,21 +528,21 @@ if sys.platform != "win32":
def getresgid() -> tuple[int, int, int]: ...
def getuid() -> int: ...
def setegid(__egid: int) -> None: ...
def seteuid(__euid: int) -> None: ...
def setgid(__gid: int) -> None: ...
def setgroups(__groups: Sequence[int]) -> None: ...
def setegid(egid: int, /) -> None: ...
def seteuid(euid: int, /) -> None: ...
def setgid(gid: int, /) -> None: ...
def setgroups(groups: Sequence[int], /) -> None: ...
def setpgrp() -> None: ...
def setpgid(__pid: int, __pgrp: int) -> None: ...
def setregid(__rgid: int, __egid: int) -> None: ...
def setpgid(pid: int, pgrp: int, /) -> None: ...
def setregid(rgid: int, egid: int, /) -> None: ...
if sys.platform != "darwin":
def setresgid(__rgid: int, __egid: int, __sgid: int) -> None: ...
def setresuid(__ruid: int, __euid: int, __suid: int) -> None: ...
def setresgid(rgid: int, egid: int, sgid: int, /) -> None: ...
def setresuid(ruid: int, euid: int, suid: int, /) -> None: ...
def setreuid(__ruid: int, __euid: int) -> None: ...
def getsid(__pid: int) -> int: ...
def setreuid(ruid: int, euid: int, /) -> None: ...
def getsid(pid: int, /) -> int: ...
def setsid() -> None: ...
def setuid(__uid: int) -> None: ...
def setuid(uid: int, /) -> None: ...
def uname() -> uname_result: ...
@overload
@@ -555,14 +555,14 @@ if sys.platform != "win32":
def getenvb(key: bytes) -> bytes | None: ...
@overload
def getenvb(key: bytes, default: _T) -> bytes | _T: ...
def putenv(__name: StrOrBytesPath, __value: StrOrBytesPath) -> None: ...
def unsetenv(__name: StrOrBytesPath) -> None: ...
def putenv(name: StrOrBytesPath, value: StrOrBytesPath, /) -> None: ...
def unsetenv(name: StrOrBytesPath, /) -> None: ...
else:
def putenv(__name: str, __value: str) -> None: ...
def putenv(name: str, value: str, /) -> None: ...
if sys.version_info >= (3, 9):
def unsetenv(__name: str) -> None: ...
def unsetenv(name: str, /) -> None: ...
_Opener: TypeAlias = Callable[[str, int], int]
@@ -644,50 +644,50 @@ def fdopen(
opener: _Opener | None = ...,
) -> IO[Any]: ...
def close(fd: int) -> None: ...
def closerange(__fd_low: int, __fd_high: int) -> None: ...
def closerange(fd_low: int, fd_high: int, /) -> None: ...
def device_encoding(fd: int) -> str | None: ...
def dup(__fd: int) -> int: ...
def dup(fd: int, /) -> int: ...
def dup2(fd: int, fd2: int, inheritable: bool = True) -> int: ...
def fstat(fd: int) -> stat_result: ...
def ftruncate(__fd: int, __length: int) -> None: ...
def ftruncate(fd: int, length: int, /) -> None: ...
def fsync(fd: FileDescriptorLike) -> None: ...
def isatty(__fd: int) -> bool: ...
def isatty(fd: int, /) -> bool: ...
if sys.platform != "win32" and sys.version_info >= (3, 11):
def login_tty(__fd: int) -> None: ...
def login_tty(fd: int, /) -> None: ...
if sys.version_info >= (3, 11):
def lseek(__fd: int, __position: int, __whence: int) -> int: ...
def lseek(fd: int, position: int, whence: int, /) -> int: ...
else:
def lseek(__fd: int, __position: int, __how: int) -> int: ...
def lseek(fd: int, position: int, how: int, /) -> int: ...
def open(path: StrOrBytesPath, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int: ...
def pipe() -> tuple[int, int]: ...
def read(__fd: int, __length: int) -> bytes: ...
def read(fd: int, length: int, /) -> bytes: ...
if sys.version_info >= (3, 12) or sys.platform != "win32":
def get_blocking(__fd: int) -> bool: ...
def set_blocking(__fd: int, __blocking: bool) -> None: ...
def get_blocking(fd: int, /) -> bool: ...
def set_blocking(fd: int, blocking: bool, /) -> None: ...
if sys.platform != "win32":
def fchmod(fd: int, mode: int) -> None: ...
def fchown(fd: int, uid: int, gid: int) -> None: ...
def fpathconf(__fd: int, __name: str | int) -> int: ...
def fstatvfs(__fd: int) -> statvfs_result: ...
def lockf(__fd: int, __command: int, __length: int) -> None: ...
def fpathconf(fd: int, name: str | int, /) -> int: ...
def fstatvfs(fd: int, /) -> statvfs_result: ...
def lockf(fd: int, command: int, length: int, /) -> None: ...
def openpty() -> tuple[int, int]: ... # some flavors of Unix
if sys.platform != "darwin":
def fdatasync(fd: FileDescriptorLike) -> None: ...
def pipe2(__flags: int) -> tuple[int, int]: ... # some flavors of Unix
def posix_fallocate(__fd: int, __offset: int, __length: int) -> None: ...
def posix_fadvise(__fd: int, __offset: int, __length: int, __advice: int) -> None: ...
def pipe2(flags: int, /) -> tuple[int, int]: ... # some flavors of Unix
def posix_fallocate(fd: int, offset: int, length: int, /) -> None: ...
def posix_fadvise(fd: int, offset: int, length: int, advice: int, /) -> None: ...
def pread(__fd: int, __length: int, __offset: int) -> bytes: ...
def pwrite(__fd: int, __buffer: ReadableBuffer, __offset: int) -> int: ...
def pread(fd: int, length: int, offset: int, /) -> bytes: ...
def pwrite(fd: int, buffer: ReadableBuffer, offset: int, /) -> int: ...
# In CI, stubtest sometimes reports that these are available on MacOS, sometimes not
def preadv(__fd: int, __buffers: SupportsLenAndGetItem[WriteableBuffer], __offset: int, __flags: int = 0) -> int: ...
def pwritev(__fd: int, __buffers: SupportsLenAndGetItem[ReadableBuffer], __offset: int, __flags: int = 0) -> int: ...
def preadv(fd: int, buffers: SupportsLenAndGetItem[WriteableBuffer], offset: int, flags: int = 0, /) -> int: ...
def pwritev(fd: int, buffers: SupportsLenAndGetItem[ReadableBuffer], offset: int, flags: int = 0, /) -> int: ...
if sys.platform != "darwin":
if sys.version_info >= (3, 10):
RWF_APPEND: int # docs say available on 3.7+, stubtest says otherwise
@@ -709,8 +709,8 @@ if sys.platform != "win32":
flags: int = 0,
) -> int: ... # FreeBSD and Mac OS X only
def readv(__fd: int, __buffers: SupportsLenAndGetItem[WriteableBuffer]) -> int: ...
def writev(__fd: int, __buffers: SupportsLenAndGetItem[ReadableBuffer]) -> int: ...
def readv(fd: int, buffers: SupportsLenAndGetItem[WriteableBuffer], /) -> int: ...
def writev(fd: int, buffers: SupportsLenAndGetItem[ReadableBuffer], /) -> int: ...
@final
class terminal_size(structseq[int], tuple[int, int]):
@@ -722,21 +722,21 @@ class terminal_size(structseq[int], tuple[int, int]):
@property
def lines(self) -> int: ...
def get_terminal_size(__fd: int = ...) -> terminal_size: ...
def get_inheritable(__fd: int) -> bool: ...
def set_inheritable(__fd: int, __inheritable: bool) -> None: ...
def get_terminal_size(fd: int = ..., /) -> terminal_size: ...
def get_inheritable(fd: int, /) -> bool: ...
def set_inheritable(fd: int, inheritable: bool, /) -> None: ...
if sys.platform == "win32":
def get_handle_inheritable(__handle: int) -> bool: ...
def set_handle_inheritable(__handle: int, __inheritable: bool) -> None: ...
def get_handle_inheritable(handle: int, /) -> bool: ...
def set_handle_inheritable(handle: int, inheritable: bool, /) -> None: ...
if sys.platform != "win32":
# Unix only
def tcgetpgrp(__fd: int) -> int: ...
def tcsetpgrp(__fd: int, __pgid: int) -> None: ...
def ttyname(__fd: int) -> str: ...
def tcgetpgrp(fd: int, /) -> int: ...
def tcsetpgrp(fd: int, pgid: int, /) -> None: ...
def ttyname(fd: int, /) -> str: ...
def write(__fd: int, __data: ReadableBuffer) -> int: ...
def write(fd: int, data: ReadableBuffer, /) -> int: ...
def access(
path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, effective_ids: bool = False, follow_symlinks: bool = True
) -> bool: ...
@@ -779,9 +779,9 @@ def makedirs(name: StrOrBytesPath, mode: int = 0o777, exist_ok: bool = False) ->
if sys.platform != "win32":
def mknod(path: StrOrBytesPath, mode: int = 0o600, device: int = 0, *, dir_fd: int | None = None) -> None: ...
def major(__device: int) -> int: ...
def minor(__device: int) -> int: ...
def makedev(__major: int, __minor: int) -> int: ...
def major(device: int, /) -> int: ...
def minor(device: int, /) -> int: ...
def makedev(major: int, minor: int, /) -> int: ...
def pathconf(path: FileDescriptorOrPath, name: str | int) -> int: ... # Unix only
def readlink(path: GenericPath[AnyStr], *, dir_fd: int | None = None) -> AnyStr: ...
@@ -901,21 +901,21 @@ _ExecVArgs: TypeAlias = (
# we limit to str | bytes.
_ExecEnv: TypeAlias = Mapping[bytes, bytes | str] | Mapping[str, bytes | str]
def execv(__path: StrOrBytesPath, __argv: _ExecVArgs) -> NoReturn: ...
def execv(path: StrOrBytesPath, argv: _ExecVArgs, /) -> NoReturn: ...
def execve(path: FileDescriptorOrPath, argv: _ExecVArgs, env: _ExecEnv) -> NoReturn: ...
def execvp(file: StrOrBytesPath, args: _ExecVArgs) -> NoReturn: ...
def execvpe(file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ...
def _exit(status: int) -> NoReturn: ...
def kill(__pid: int, __signal: int) -> None: ...
def kill(pid: int, signal: int, /) -> None: ...
if sys.platform != "win32":
# Unix only
def fork() -> int: ...
def forkpty() -> tuple[int, int]: ... # some flavors of Unix
def killpg(__pgid: int, __signal: int) -> None: ...
def nice(__increment: int) -> int: ...
def killpg(pgid: int, signal: int, /) -> None: ...
def nice(increment: int, /) -> int: ...
if sys.platform != "darwin":
def plock(__op: int) -> None: ... # ???op is int?
def plock(op: int, /) -> None: ... # ???op is int?
class _wrap_close(_TextIOWrapper):
def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ...
@@ -930,8 +930,8 @@ if sys.platform != "win32":
def spawnve(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...
else:
def spawnv(__mode: int, __path: StrOrBytesPath, __argv: _ExecVArgs) -> int: ...
def spawnve(__mode: int, __path: StrOrBytesPath, __argv: _ExecVArgs, __env: _ExecEnv) -> int: ...
def spawnv(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, /) -> int: ...
def spawnve(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, env: _ExecEnv, /) -> int: ...
def system(command: StrOrBytesPath) -> int: ...
@final
@@ -951,7 +951,7 @@ class times_result(structseq[float], tuple[float, float, float, float, float]):
def elapsed(self) -> float: ...
def times() -> times_result: ...
def waitpid(__pid: int, __options: int) -> tuple[int, int]: ...
def waitpid(pid: int, options: int, /) -> tuple[int, int]: ...
if sys.platform == "win32":
if sys.version_info >= (3, 10):
@@ -988,13 +988,13 @@ else:
@property
def si_code(self) -> int: ...
def waitid(__idtype: int, __ident: int, __options: int) -> waitid_result | None: ...
def waitid(idtype: int, ident: int, options: int, /) -> waitid_result | None: ...
from resource import struct_rusage
def wait3(options: int) -> tuple[int, int, struct_rusage]: ...
def wait4(pid: int, options: int) -> tuple[int, int, struct_rusage]: ...
def WCOREDUMP(__status: int) -> bool: ...
def WCOREDUMP(status: int, /) -> bool: ...
def WIFCONTINUED(status: int) -> bool: ...
def WIFSTOPPED(status: int) -> bool: ...
def WIFSIGNALED(status: int) -> bool: ...
@@ -1003,9 +1003,10 @@ else:
def WSTOPSIG(status: int) -> int: ...
def WTERMSIG(status: int) -> int: ...
def posix_spawn(
__path: StrOrBytesPath,
__argv: _ExecVArgs,
__env: _ExecEnv,
path: StrOrBytesPath,
argv: _ExecVArgs,
env: _ExecEnv,
/,
*,
file_actions: Sequence[tuple[Any, ...]] | None = ...,
setpgroup: int | None = ...,
@@ -1016,9 +1017,10 @@ else:
scheduler: tuple[Any, sched_param] | None = ...,
) -> int: ...
def posix_spawnp(
__path: StrOrBytesPath,
__argv: _ExecVArgs,
__env: _ExecEnv,
path: StrOrBytesPath,
argv: _ExecVArgs,
env: _ExecEnv,
/,
*,
file_actions: Sequence[tuple[Any, ...]] | None = ...,
setpgroup: int | None = ...,
@@ -1046,26 +1048,26 @@ if sys.platform != "win32":
def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix
def sched_yield() -> None: ... # some flavors of Unix
if sys.platform != "darwin":
def sched_setscheduler(__pid: int, __policy: int, __param: sched_param) -> None: ... # some flavors of Unix
def sched_getscheduler(__pid: int) -> int: ... # some flavors of Unix
def sched_rr_get_interval(__pid: int) -> float: ... # some flavors of Unix
def sched_setparam(__pid: int, __param: sched_param) -> None: ... # some flavors of Unix
def sched_getparam(__pid: int) -> sched_param: ... # some flavors of Unix
def sched_setaffinity(__pid: int, __mask: Iterable[int]) -> None: ... # some flavors of Unix
def sched_getaffinity(__pid: int) -> set[int]: ... # some flavors of Unix
def sched_setscheduler(pid: int, policy: int, param: sched_param, /) -> None: ... # some flavors of Unix
def sched_getscheduler(pid: int, /) -> int: ... # some flavors of Unix
def sched_rr_get_interval(pid: int, /) -> float: ... # some flavors of Unix
def sched_setparam(pid: int, param: sched_param, /) -> None: ... # some flavors of Unix
def sched_getparam(pid: int, /) -> sched_param: ... # some flavors of Unix
def sched_setaffinity(pid: int, mask: Iterable[int], /) -> None: ... # some flavors of Unix
def sched_getaffinity(pid: int, /) -> set[int]: ... # some flavors of Unix
def cpu_count() -> int | None: ...
if sys.platform != "win32":
# Unix only
def confstr(__name: str | int) -> str | None: ...
def confstr(name: str | int, /) -> str | None: ...
def getloadavg() -> tuple[float, float, float]: ...
def sysconf(__name: str | int) -> int: ...
def sysconf(name: str | int, /) -> int: ...
if sys.platform == "linux":
def getrandom(size: int, flags: int = 0) -> bytes: ...
def urandom(__size: int) -> bytes: ...
def urandom(size: int, /) -> bytes: ...
if sys.platform != "win32":
def register_at_fork(

View File

@@ -59,7 +59,7 @@ class PurePath(PathLike[str]):
def is_absolute(self) -> bool: ...
def is_reserved(self) -> bool: ...
if sys.version_info >= (3, 12):
def is_relative_to(self, __other: StrPath, *_deprecated: StrPath) -> bool: ...
def is_relative_to(self, other: StrPath, /, *_deprecated: StrPath) -> bool: ...
elif sys.version_info >= (3, 9):
def is_relative_to(self, *other: StrPath) -> bool: ...
@@ -69,7 +69,7 @@ class PurePath(PathLike[str]):
def match(self, path_pattern: str) -> bool: ...
if sys.version_info >= (3, 12):
def relative_to(self, __other: StrPath, *_deprecated: StrPath, walk_up: bool = False) -> Self: ...
def relative_to(self, other: StrPath, /, *_deprecated: StrPath, walk_up: bool = False) -> Self: ...
else:
def relative_to(self, *other: StrPath) -> Self: ...

View File

@@ -94,7 +94,7 @@ DEFAULT_PROTOCOL: int
bytes_types: tuple[type[Any], ...] # undocumented
class _ReadableFileobj(Protocol):
def read(self, __n: int) -> bytes: ...
def read(self, n: int, /) -> bytes: ...
def readline(self) -> bytes: ...
@final
@@ -102,8 +102,8 @@ class PickleBuffer:
def __init__(self, buffer: ReadableBuffer) -> None: ...
def raw(self) -> memoryview: ...
def release(self) -> None: ...
def __buffer__(self, __flags: int) -> memoryview: ...
def __release_buffer__(self, __buffer: memoryview) -> None: ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
_BufferCallback: TypeAlias = Callable[[PickleBuffer], Any] | None
@@ -127,7 +127,8 @@ def load(
buffers: Iterable[Any] | None = (),
) -> Any: ...
def loads(
__data: ReadableBuffer,
data: ReadableBuffer,
/,
*,
fix_imports: bool = True,
encoding: str = "ASCII",
@@ -162,7 +163,7 @@ class Pickler:
buffer_callback: _BufferCallback = ...,
) -> None: ...
def reducer_override(self, obj: Any) -> Any: ...
def dump(self, __obj: Any) -> None: ...
def dump(self, obj: Any, /) -> None: ...
def clear_memo(self) -> None: ...
def persistent_id(self, obj: Any) -> Any: ...
@@ -179,7 +180,7 @@ class Unpickler:
buffers: Iterable[Any] | None = ...,
) -> None: ...
def load(self) -> Any: ...
def find_class(self, __module_name: str, __global_name: str) -> Any: ...
def find_class(self, module_name: str, global_name: str, /) -> Any: ...
def persistent_load(self, pid: Any) -> Any: ...
MARK: bytes

View File

@@ -112,11 +112,11 @@ def commonpath(paths: Iterable[BytesPath]) -> bytes: ...
# but must be defined as pos-only in the stub or cross-platform code doesn't type-check,
# as the parameter name is different in ntpath.join()
@overload
def join(__a: LiteralString, *paths: LiteralString) -> LiteralString: ...
def join(a: LiteralString, /, *paths: LiteralString) -> LiteralString: ...
@overload
def join(__a: StrPath, *paths: StrPath) -> str: ...
def join(a: StrPath, /, *paths: StrPath) -> str: ...
@overload
def join(__a: BytesPath, *paths: BytesPath) -> bytes: ...
def join(a: BytesPath, /, *paths: BytesPath) -> bytes: ...
if sys.version_info >= (3, 10):
@overload

View File

@@ -27,5 +27,5 @@ class Profile:
def snapshot_stats(self) -> None: ...
def run(self, cmd: str) -> Self: ...
def runctx(self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ...
def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kw: _P.kwargs) -> _T: ...
def calibrate(self, m: int, verbose: int = 0) -> float: ...

View File

@@ -48,7 +48,8 @@ class Stats:
sort_arg_dict_default: _SortArgDict
def __init__(
self,
__arg: None | str | Profile | _cProfile = ...,
arg: None | str | Profile | _cProfile = ...,
/,
*args: None | str | Profile | _cProfile | Self,
stream: IO[Any] | None = None,
) -> None: ...

View File

@@ -24,5 +24,5 @@ if sys.platform != "win32":
def pw_shell(self) -> str: ...
def getpwall() -> list[struct_passwd]: ...
def getpwuid(__uid: int) -> struct_passwd: ...
def getpwnam(__name: str) -> struct_passwd: ...
def getpwuid(uid: int, /) -> struct_passwd: ...
def getpwnam(name: str, /) -> struct_passwd: ...

View File

@@ -24,14 +24,14 @@ _Model: TypeAlias = tuple[int, int, str | None, tuple[Any, ...]]
@final
class XMLParserType:
def Parse(self, __data: str | ReadableBuffer, __isfinal: bool = False) -> int: ...
def ParseFile(self, __file: SupportsRead[bytes]) -> int: ...
def SetBase(self, __base: str) -> None: ...
def Parse(self, data: str | ReadableBuffer, isfinal: bool = False, /) -> int: ...
def ParseFile(self, file: SupportsRead[bytes], /) -> int: ...
def SetBase(self, base: str, /) -> None: ...
def GetBase(self) -> str | None: ...
def GetInputContext(self) -> bytes | None: ...
def ExternalEntityParserCreate(self, __context: str | None, __encoding: str = ...) -> XMLParserType: ...
def SetParamEntityParsing(self, __flag: int) -> int: ...
def UseForeignDTD(self, __flag: bool = True) -> None: ...
def ExternalEntityParserCreate(self, context: str | None, encoding: str = ..., /) -> XMLParserType: ...
def SetParamEntityParsing(self, flag: int, /) -> int: ...
def UseForeignDTD(self, flag: bool = True, /) -> None: ...
@property
def intern(self) -> dict[str, str]: ...
buffer_size: int
@@ -75,7 +75,7 @@ class XMLParserType:
ExternalEntityRefHandler: Callable[[str, str | None, str | None, str | None], int] | None
SkippedEntityHandler: Callable[[str, bool], Any] | None
def ErrorString(__code: int) -> str: ...
def ErrorString(code: int, /) -> str: ...
# intern is undocumented
def ParserCreate(

View File

@@ -72,11 +72,11 @@ class Match(Generic[AnyStr]):
def expand(self, template: AnyStr) -> AnyStr: ...
# group() returns "AnyStr" or "AnyStr | None", depending on the pattern.
@overload
def group(self, __group: Literal[0] = 0) -> AnyStr: ...
def group(self, group: Literal[0] = 0, /) -> AnyStr: ...
@overload
def group(self, __group: str | int) -> AnyStr | Any: ...
def group(self, group: str | int, /) -> AnyStr | Any: ...
@overload
def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> tuple[AnyStr | Any, ...]: ...
def group(self, group1: str | int, group2: str | int, /, *groups: str | int) -> tuple[AnyStr | Any, ...]: ...
# Each item of groups()'s return tuple is either "AnyStr" or
# "AnyStr | None", depending on the pattern.
@overload
@@ -89,18 +89,18 @@ class Match(Generic[AnyStr]):
def groupdict(self) -> dict[str, AnyStr | Any]: ...
@overload
def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ...
def start(self, __group: int | str = 0) -> int: ...
def end(self, __group: int | str = 0) -> int: ...
def span(self, __group: int | str = 0) -> tuple[int, int]: ...
def start(self, group: int | str = 0, /) -> int: ...
def end(self, group: int | str = 0, /) -> int: ...
def span(self, group: int | str = 0, /) -> tuple[int, int]: ...
@property
def regs(self) -> tuple[tuple[int, int], ...]: ... # undocumented
# __getitem__() returns "AnyStr" or "AnyStr | None", depending on the pattern.
@overload
def __getitem__(self, __key: Literal[0]) -> AnyStr: ...
def __getitem__(self, key: Literal[0], /) -> AnyStr: ...
@overload
def __getitem__(self, __key: int | str) -> AnyStr | Any: ...
def __getitem__(self, key: int | str, /) -> AnyStr | Any: ...
def __copy__(self) -> Match[AnyStr]: ...
def __deepcopy__(self, __memo: Any) -> Match[AnyStr]: ...
def __deepcopy__(self, memo: Any, /) -> Match[AnyStr]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -174,8 +174,8 @@ class Pattern(Generic[AnyStr]):
@overload
def subn(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> tuple[AnyStr, int]: ...
def __copy__(self) -> Pattern[AnyStr]: ...
def __deepcopy__(self, __memo: Any) -> Pattern[AnyStr]: ...
def __eq__(self, __value: object) -> bool: ...
def __deepcopy__(self, memo: Any, /) -> Pattern[AnyStr]: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...

View File

@@ -7,30 +7,30 @@ if sys.platform != "win32":
_Completer: TypeAlias = Callable[[str, int], str | None]
_CompDisp: TypeAlias = Callable[[str, Sequence[str], int], None]
def parse_and_bind(__string: str) -> None: ...
def read_init_file(__filename: StrOrBytesPath | None = None) -> None: ...
def parse_and_bind(string: str, /) -> None: ...
def read_init_file(filename: StrOrBytesPath | None = None, /) -> None: ...
def get_line_buffer() -> str: ...
def insert_text(__string: str) -> None: ...
def insert_text(string: str, /) -> None: ...
def redisplay() -> None: ...
def read_history_file(__filename: StrOrBytesPath | None = None) -> None: ...
def write_history_file(__filename: StrOrBytesPath | None = None) -> None: ...
def append_history_file(__nelements: int, __filename: StrOrBytesPath | None = None) -> None: ...
def read_history_file(filename: StrOrBytesPath | None = None, /) -> None: ...
def write_history_file(filename: StrOrBytesPath | None = None, /) -> None: ...
def append_history_file(nelements: int, filename: StrOrBytesPath | None = None, /) -> None: ...
def get_history_length() -> int: ...
def set_history_length(__length: int) -> None: ...
def set_history_length(length: int, /) -> None: ...
def clear_history() -> None: ...
def get_current_history_length() -> int: ...
def get_history_item(__index: int) -> str: ...
def remove_history_item(__pos: int) -> None: ...
def replace_history_item(__pos: int, __line: str) -> None: ...
def add_history(__string: str) -> None: ...
def set_auto_history(__enabled: bool) -> None: ...
def set_startup_hook(__function: Callable[[], object] | None = None) -> None: ...
def set_pre_input_hook(__function: Callable[[], object] | None = None) -> None: ...
def set_completer(__function: _Completer | None = None) -> None: ...
def get_history_item(index: int, /) -> str: ...
def remove_history_item(pos: int, /) -> None: ...
def replace_history_item(pos: int, line: str, /) -> None: ...
def add_history(string: str, /) -> None: ...
def set_auto_history(enabled: bool, /) -> None: ...
def set_startup_hook(function: Callable[[], object] | None = None, /) -> None: ...
def set_pre_input_hook(function: Callable[[], object] | None = None, /) -> None: ...
def set_completer(function: _Completer | None = None, /) -> None: ...
def get_completer() -> _Completer | None: ...
def get_completion_type() -> int: ...
def get_begidx() -> int: ...
def get_endidx() -> int: ...
def set_completer_delims(__string: str) -> None: ...
def set_completer_delims(string: str, /) -> None: ...
def get_completer_delims() -> str: ...
def set_completion_display_matches_hook(__function: _CompDisp | None = None) -> None: ...
def set_completion_display_matches_hook(function: _CompDisp | None = None, /) -> None: ...

View File

@@ -83,12 +83,12 @@ if sys.platform != "win32":
def ru_nivcsw(self) -> int: ...
def getpagesize() -> int: ...
def getrlimit(__resource: int) -> tuple[int, int]: ...
def getrusage(__who: int) -> struct_rusage: ...
def setrlimit(__resource: int, __limits: tuple[int, int]) -> None: ...
def getrlimit(resource: int, /) -> tuple[int, int]: ...
def getrusage(who: int, /) -> struct_rusage: ...
def setrlimit(resource: int, limits: tuple[int, int], /) -> None: ...
if sys.platform == "linux":
if sys.version_info >= (3, 12):
def prlimit(__pid: int, __resource: int, __limits: tuple[int, int] | None = None) -> tuple[int, int]: ...
def prlimit(pid: int, resource: int, limits: tuple[int, int] | None = None, /) -> tuple[int, int]: ...
else:
def prlimit(__pid: int, __resource: int, __limits: tuple[int, int] = ...) -> tuple[int, int]: ...
def prlimit(pid: int, resource: int, limits: tuple[int, int] = ..., /) -> tuple[int, int]: ...
error = OSError

View File

@@ -28,7 +28,7 @@ class poll:
def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ...
def select(
__rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: float | None = None
rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, /
) -> tuple[list[Any], list[Any], list[Any]]: ...
error = OSError
@@ -60,11 +60,11 @@ if sys.platform != "linux" and sys.platform != "win32":
def __init__(self) -> None: ...
def close(self) -> None: ...
def control(
self, __changelist: Iterable[kevent] | None, __maxevents: int, __timeout: float | None = None
self, changelist: Iterable[kevent] | None, maxevents: int, timeout: float | None = None, /
) -> list[kevent]: ...
def fileno(self) -> int: ...
@classmethod
def fromfd(cls, __fd: FileDescriptorLike) -> kqueue: ...
def fromfd(cls, fd: FileDescriptorLike, /) -> kqueue: ...
KQ_EV_ADD: int
KQ_EV_CLEAR: int
@@ -112,9 +112,10 @@ if sys.platform == "linux":
def __enter__(self) -> Self: ...
def __exit__(
self,
__exc_type: type[BaseException] | None = None,
__exc_value: BaseException | None = ...,
__exc_tb: TracebackType | None = None,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = ...,
exc_tb: TracebackType | None = None,
/,
) -> None: ...
def close(self) -> None: ...
closed: bool
@@ -124,7 +125,7 @@ if sys.platform == "linux":
def unregister(self, fd: FileDescriptorLike) -> None: ...
def poll(self, timeout: float | None = None, maxevents: int = -1) -> list[tuple[int, int]]: ...
@classmethod
def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ...
def fromfd(cls, fd: FileDescriptorLike, /) -> epoll: ...
EPOLLERR: int
EPOLLEXCLUSIVE: int

View File

@@ -67,15 +67,15 @@ SIG_IGN: Handlers
_SIGNUM: TypeAlias = int | Signals
_HANDLER: TypeAlias = Callable[[int, FrameType | None], Any] | int | Handlers | None
def default_int_handler(__signalnum: int, __frame: FrameType | None) -> Never: ...
def default_int_handler(signalnum: int, frame: FrameType | None, /) -> Never: ...
if sys.version_info >= (3, 10): # arguments changed in 3.10.2
def getsignal(signalnum: _SIGNUM) -> _HANDLER: ...
def signal(signalnum: _SIGNUM, handler: _HANDLER) -> _HANDLER: ...
else:
def getsignal(__signalnum: _SIGNUM) -> _HANDLER: ...
def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ...
def getsignal(signalnum: _SIGNUM, /) -> _HANDLER: ...
def signal(signalnum: _SIGNUM, handler: _HANDLER, /) -> _HANDLER: ...
SIGABRT: Signals
SIGFPE: Signals
@@ -130,22 +130,22 @@ else:
SIG_BLOCK = Sigmasks.SIG_BLOCK
SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK
SIG_SETMASK = Sigmasks.SIG_SETMASK
def alarm(__seconds: int) -> int: ...
def getitimer(__which: int) -> tuple[float, float]: ...
def alarm(seconds: int, /) -> int: ...
def getitimer(which: int, /) -> tuple[float, float]: ...
def pause() -> None: ...
def pthread_kill(__thread_id: int, __signalnum: int) -> None: ...
def pthread_kill(thread_id: int, signalnum: int, /) -> None: ...
if sys.version_info >= (3, 10): # arguments changed in 3.10.2
def pthread_sigmask(how: int, mask: Iterable[int]) -> set[_SIGNUM]: ...
else:
def pthread_sigmask(__how: int, __mask: Iterable[int]) -> set[_SIGNUM]: ...
def pthread_sigmask(how: int, mask: Iterable[int], /) -> set[_SIGNUM]: ...
def setitimer(__which: int, __seconds: float, __interval: float = 0.0) -> tuple[float, float]: ...
def siginterrupt(__signalnum: int, __flag: bool) -> None: ...
def setitimer(which: int, seconds: float, interval: float = 0.0, /) -> tuple[float, float]: ...
def siginterrupt(signalnum: int, flag: bool, /) -> None: ...
def sigpending() -> Any: ...
if sys.version_info >= (3, 10): # argument changed in 3.10.2
def sigwait(sigset: Iterable[int]) -> _SIGNUM: ...
else:
def sigwait(__sigset: Iterable[int]) -> _SIGNUM: ...
def sigwait(sigset: Iterable[int], /) -> _SIGNUM: ...
if sys.platform != "darwin":
SIGCLD: Signals
SIGPOLL: Signals
@@ -176,17 +176,17 @@ else:
def si_band(self) -> int: ...
if sys.version_info >= (3, 10):
def sigtimedwait(__sigset: Iterable[int], __timeout: float) -> struct_siginfo | None: ...
def sigwaitinfo(__sigset: Iterable[int]) -> struct_siginfo: ...
def sigtimedwait(sigset: Iterable[int], timeout: float, /) -> struct_siginfo | None: ...
def sigwaitinfo(sigset: Iterable[int], /) -> struct_siginfo: ...
else:
def sigtimedwait(sigset: Iterable[int], timeout: float) -> struct_siginfo | None: ...
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ...
def strsignal(__signalnum: _SIGNUM) -> str | None: ...
def strsignal(signalnum: _SIGNUM, /) -> str | None: ...
def valid_signals() -> set[Signals]: ...
def raise_signal(__signalnum: _SIGNUM) -> None: ...
def raise_signal(signalnum: _SIGNUM, /) -> None: ...
def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ...
if sys.version_info >= (3, 9):
if sys.platform == "linux":
def pidfd_send_signal(__pidfd: int, __sig: int, __siginfo: None = None, __flags: int = ...) -> None: ...
def pidfd_send_signal(pidfd: int, sig: int, siginfo: None = None, flags: int = ..., /) -> None: ...

Some files were not shown because too many files have changed in this diff Show More