diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f957cada..40cfe7f4c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 21.12b0 # must match requirements-tests.txt + rev: 22.1.0 # must match requirements-tests.txt hooks: - id: black language_version: python3.9 diff --git a/requirements-tests.txt b/requirements-tests.txt index 364bc3bce..228748876 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,7 +1,7 @@ mypy==0.931 pytype==2022.01.05; platform_system != "Windows" and python_version < "3.10" # must match .pre-commit-config.yaml -black==21.12b0 +black==22.1.0 flake8==4.0.1 flake8-bugbear==21.11.29 flake8-pyi==22.1.0 diff --git a/stdlib/@python2/SocketServer.pyi b/stdlib/@python2/SocketServer.pyi index 809066516..7c72675e6 100644 --- a/stdlib/@python2/SocketServer.pyi +++ b/stdlib/@python2/SocketServer.pyi @@ -50,6 +50,7 @@ if sys.platform != "win32": RequestHandlerClass: Callable[..., BaseRequestHandler], bind_and_activate: bool = ..., ) -> None: ... + class UnixDatagramServer(BaseServer): def __init__( self, diff --git a/stdlib/@python2/asyncore.pyi b/stdlib/@python2/asyncore.pyi index a7ef4df1f..1daa1aac8 100644 --- a/stdlib/@python2/asyncore.pyi +++ b/stdlib/@python2/asyncore.pyi @@ -113,6 +113,7 @@ if sys.platform != "win32": def write(self, data: bytes, flags: int = ...) -> int: ... def close(self) -> None: ... def fileno(self) -> int: ... + class file_dispatcher(dispatcher): def __init__(self, fd: FileDescriptorLike, map: _maptype | None = ...) -> None: ... def set_file(self, fd: int) -> None: ... diff --git a/stdlib/@python2/distutils/command/bdist_msi.pyi b/stdlib/@python2/distutils/command/bdist_msi.pyi index 150229fb0..09351d29a 100644 --- a/stdlib/@python2/distutils/command/bdist_msi.pyi +++ b/stdlib/@python2/distutils/command/bdist_msi.pyi @@ -2,6 +2,7 @@ import sys if sys.platform == "win32": from distutils.cmd import Command + class bdist_msi(Command): def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... diff --git a/stdlib/@python2/mmap.pyi b/stdlib/@python2/mmap.pyi index 44369e6c0..4e08bc28c 100644 --- a/stdlib/@python2/mmap.pyi +++ b/stdlib/@python2/mmap.pyi @@ -30,6 +30,7 @@ class mmap(Sequence[bytes]): def __init__( self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ... ) -> None: ... + def close(self) -> None: ... def flush(self, offset: int = ..., size: int = ...) -> int: ... def move(self, dest: int, src: int, count: int) -> None: ... diff --git a/stdlib/@python2/msilib/__init__.pyi b/stdlib/@python2/msilib/__init__.pyi index 381ddffa5..a49f37f0d 100644 --- a/stdlib/@python2/msilib/__init__.pyi +++ b/stdlib/@python2/msilib/__init__.pyi @@ -21,6 +21,7 @@ if sys.platform == "win32": type_nullable: Literal[0x1000] type_key: Literal[0x2000] knownbits: Literal[0x3FFF] + class Table: name: str @@ -29,7 +30,9 @@ if sys.platform == "win32": def add_field(self, index: int, name: str, type: int) -> None: ... def sql(self) -> str: ... def create(self, db: _Database) -> None: ... + class _Unspecified: ... + def change_sequence( seq: Sequence[tuple[str, str | None, int]], action: str, @@ -44,6 +47,7 @@ if sys.platform == "win32": def add_tables(db: _Database, module: ModuleType) -> None: ... def make_id(str: str) -> str: ... def gen_uuid() -> str: ... + class CAB: name: str @@ -55,6 +59,7 @@ if sys.platform == "win32": def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ... def commit(self, db: _Database) -> None: ... _directories: set[str] + class Directory: db: _Database @@ -90,10 +95,12 @@ if sys.platform == "win32": def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ... def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ... def remove_pyc(self) -> None: ... + class Binary: name: str def __init__(self, fname: str) -> None: ... + class Feature: id: str @@ -110,6 +117,7 @@ if sys.platform == "win32": attributes: int = ..., ) -> None: ... def set_current(self) -> None: ... + class Control: dlg: Dialog @@ -118,12 +126,14 @@ if sys.platform == "win32": def event(self, event: str, argument: str, condition: str = ..., ordering: int | None = ...) -> None: ... def mapping(self, event: str, attribute: str) -> None: ... def condition(self, action: str, condition: str) -> None: ... + class RadioButtonGroup(Control): property: str index: int def __init__(self, dlg: Dialog, name: str, property: str) -> None: ... def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = ...) -> None: ... + class Dialog: db: _Database diff --git a/stdlib/@python2/nis.pyi b/stdlib/@python2/nis.pyi index b762ae462..10eef2336 100644 --- a/stdlib/@python2/nis.pyi +++ b/stdlib/@python2/nis.pyi @@ -5,4 +5,5 @@ if sys.platform != "win32": def get_default_domain() -> str: ... def maps(domain: str = ...) -> list[str]: ... def match(key: str, map: str, domain: str = ...) -> str: ... + class error(Exception): ... diff --git a/stdlib/@python2/os/__init__.pyi b/stdlib/@python2/os/__init__.pyi index c14ae1207..2ca9bce24 100644 --- a/stdlib/@python2/os/__init__.pyi +++ b/stdlib/@python2/os/__init__.pyi @@ -235,6 +235,7 @@ if sys.platform != "win32": def fchown(fd: int, uid: int, gid: int) -> None: ... if sys.platform != "darwin": def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: str | int) -> int: ... def fstatvfs(fd: int) -> _StatVFS: ... def ftruncate(fd: int, length: int) -> None: ... diff --git a/stdlib/@python2/resource.pyi b/stdlib/@python2/resource.pyi index 1a655604b..8deec4f67 100644 --- a/stdlib/@python2/resource.pyi +++ b/stdlib/@python2/resource.pyi @@ -18,6 +18,7 @@ if sys.platform != "win32": RLIMIT_MEMLOCK: int RLIMIT_VMEM: int RLIMIT_AS: int + class _RUsage(NamedTuple): ru_utime: float ru_stime: float diff --git a/stdlib/@python2/socket.pyi b/stdlib/@python2/socket.pyi index 3a69a3239..0981ce28a 100644 --- a/stdlib/@python2/socket.pyi +++ b/stdlib/@python2/socket.pyi @@ -404,6 +404,7 @@ class socket: def gettimeout(self) -> float | None: ... if sys.platform == "win32": def ioctl(self, control: int, option: int | tuple[int, int, int]) -> None: ... + def listen(self, __backlog: int) -> None: ... # Note that the makefile's documented windows-specific behavior is not represented def makefile(self, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... @@ -422,6 +423,7 @@ class socket: def setsockopt(self, level: int, optname: int, value: int | bytes) -> None: ... if sys.platform == "win32": def share(self, process_id: int) -> bytes: ... + def shutdown(self, how: int) -> None: ... # ----- Functions ----- diff --git a/stdlib/@python2/termios.pyi b/stdlib/@python2/termios.pyi index 7142df157..6ef2f6818 100644 --- a/stdlib/@python2/termios.pyi +++ b/stdlib/@python2/termios.pyi @@ -243,4 +243,5 @@ if sys.platform != "win32": def tcdrain(__fd: FileDescriptorLike) -> None: ... def tcflush(__fd: FileDescriptorLike, __queue: int) -> None: ... def tcflow(__fd: FileDescriptorLike, __action: int) -> None: ... + class error(Exception): ... diff --git a/stdlib/@python2/webbrowser.pyi b/stdlib/@python2/webbrowser.pyi index 8f1c8b060..33600fe32 100644 --- a/stdlib/@python2/webbrowser.pyi +++ b/stdlib/@python2/webbrowser.pyi @@ -91,6 +91,7 @@ if sys.platform == "darwin": name: str def __init__(self, name: Text) -> None: ... def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + class MacOSXOSAScript(BaseBrowser): def __init__(self, name: Text) -> None: ... def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... diff --git a/stdlib/_ast.pyi b/stdlib/_ast.pyi index d1feaf235..eea49588c 100644 --- a/stdlib/_ast.pyi +++ b/stdlib/_ast.pyi @@ -25,8 +25,10 @@ class mod(AST): ... if sys.version_info >= (3, 8): class type_ignore(AST): ... + class TypeIgnore(type_ignore): tag: str + class FunctionType(mod): argtypes: list[expr] returns: expr @@ -228,12 +230,16 @@ class JoinedStr(expr): if sys.version_info < (3, 8): class Num(expr): # Deprecated in 3.8; use Constant n: complex + class Str(expr): # Deprecated in 3.8; use Constant s: str + class Bytes(expr): # Deprecated in 3.8; use Constant s: bytes + class NameConstant(expr): # Deprecated in 3.8; use Constant value: Any + class Ellipsis(expr): ... # Deprecated in 3.8; use Constant class Constant(expr): @@ -267,6 +273,7 @@ class Slice(_SliceT): if sys.version_info < (3, 9): class ExtSlice(slice): dims: list[slice] + class Index(slice): value: expr @@ -297,6 +304,7 @@ if sys.version_info < (3, 9): class AugLoad(expr_context): ... class AugStore(expr_context): ... class Param(expr_context): ... + class Suite(mod): body: list[stmt] @@ -380,32 +388,42 @@ if sys.version_info >= (3, 10): class Match(stmt): subject: expr cases: list[match_case] + class pattern(AST): ... # Without the alias, Pyright complains variables named pattern are recursively defined _pattern = pattern + class match_case(AST): pattern: _pattern guard: expr | None body: list[stmt] + class MatchValue(pattern): value: expr + class MatchSingleton(pattern): value: Literal[True, False, None] + class MatchSequence(pattern): patterns: list[pattern] + class MatchStar(pattern): name: _identifier | None + class MatchMapping(pattern): keys: list[expr] patterns: list[pattern] rest: _identifier | None + class MatchClass(pattern): cls: expr patterns: list[pattern] kwd_attrs: list[_identifier] kwd_patterns: list[pattern] + class MatchAs(pattern): pattern: _pattern | None name: _identifier | None + class MatchOr(pattern): patterns: list[pattern] diff --git a/stdlib/_curses.pyi b/stdlib/_curses.pyi index 9f23eeb1c..33dee1ac1 100644 --- a/stdlib/_curses.pyi +++ b/stdlib/_curses.pyi @@ -280,6 +280,7 @@ if sys.platform != "win32": def color_pair(pair_number: int) -> int: ... else: def color_pair(__color_number: int) -> int: ... + def curs_set(__visibility: int) -> int: ... def def_prog_mode() -> None: ... def def_shell_mode() -> None: ... @@ -294,6 +295,7 @@ if sys.platform != "win32": if sys.version_info >= (3, 9): def get_escdelay() -> int: ... def get_tabsize() -> int: ... + def getmouse() -> tuple[int, int, int, int, int]: ... def getsyx() -> tuple[int, int]: ... def getwin(__file: SupportsRead[bytes]) -> _CursesWindow: ... @@ -301,6 +303,7 @@ if sys.platform != "win32": 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: ... @@ -339,6 +342,7 @@ if sys.platform != "win32": if sys.version_info >= (3, 9): def set_escdelay(__ms: int) -> None: ... def set_tabsize(__size: int) -> None: ... + def setsyx(__y: int, __x: int) -> None: ... def setupterm(term: str | None = ..., fd: int = ...) -> None: ... def start_color() -> None: ... @@ -367,7 +371,9 @@ if sys.platform != "win32": def update_lines_cols() -> None: ... def use_default_colors() -> None: ... def use_env(__flag: bool) -> None: ... + class error(Exception): ... + class _CursesWindow: encoding: str @overload diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi index e7a830f4a..854a30ace 100644 --- a/stdlib/_dummy_threading.pyi +++ b/stdlib/_dummy_threading.pyi @@ -55,9 +55,11 @@ class Thread: if sys.version_info >= (3, 8): @property def native_id(self) -> int | None: ... # only available on some platforms + def is_alive(self) -> bool: ... if sys.version_info < (3, 9): def isAlive(self) -> bool: ... + def isDaemon(self) -> bool: ... def setDaemon(self, daemonic: bool) -> None: ... diff --git a/stdlib/_socket.pyi b/stdlib/_socket.pyi index e0a3f8507..c948e246d 100644 --- a/stdlib/_socket.pyi +++ b/stdlib/_socket.pyi @@ -547,9 +547,11 @@ class socket: def getsockopt(self, __level: int, __optname: int, __buflen: int) -> bytes: ... if sys.version_info >= (3, 7): 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 listen(self, __backlog: int = ...) -> None: ... def recv(self, __bufsize: int, __flags: int = ...) -> bytes: ... def recvfrom(self, __bufsize: int, __flags: int = ...) -> tuple[bytes, _RetAddress]: ... @@ -558,6 +560,7 @@ class socket: def recvmsg_into( 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: ... @@ -578,6 +581,7 @@ class socket: 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: ... @overload @@ -586,6 +590,7 @@ class socket: def setsockopt(self, __level: int, __optname: int, __value: None, __optlen: int) -> None: ... if sys.platform == "win32": def share(self, __process_id: int) -> bytes: ... + def shutdown(self, __how: int) -> None: ... SocketType = socket diff --git a/stdlib/_tkinter.pyi b/stdlib/_tkinter.pyi index db1bfa866..7c0ccec1d 100644 --- a/stdlib/_tkinter.pyi +++ b/stdlib/_tkinter.pyi @@ -55,6 +55,7 @@ class TkappType: if sys.platform != "win32": def createfilehandler(self, __file, __mask, __func): ... def deletefilehandler(self, __file): ... + def createtimerhandler(self, __milliseconds, __func): ... def deletecommand(self, __name): ... def dooneevent(self, __flags: int = ...): ... @@ -79,6 +80,7 @@ class TkappType: def setvar(self, *ags, **kwargs): ... if sys.version_info < (3, 11): def split(self, __arg): ... + def splitlist(self, __arg): ... def unsetvar(self, *args, **kwargs): ... def wantobjects(self, *args, **kwargs): ... diff --git a/stdlib/_winapi.pyi b/stdlib/_winapi.pyi index eba236597..1e8c51477 100644 --- a/stdlib/_winapi.pyi +++ b/stdlib/_winapi.pyi @@ -160,6 +160,7 @@ if sys.platform == "win32": if sys.version_info >= (3, 7): def GetACP() -> int: ... def GetFileType(handle: int) -> int: ... + def GetCurrentProcess() -> int: ... def GetExitCodeProcess(__process: int) -> int: ... def GetLastError() -> int: ... diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index d2b18d42c..a611af75c 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -193,6 +193,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): help: str | None = ..., metavar: str | None = ..., ) -> _SubParsersAction[_ArgumentParserT]: ... + def print_usage(self, file: IO[str] | None = ...) -> None: ... def print_help(self, file: IO[str] | None = ...) -> None: ... def format_usage(self) -> str: ... diff --git a/stdlib/array.pyi b/stdlib/array.pyi index 87b6027f7..d9ca42de7 100644 --- a/stdlib/array.pyi +++ b/stdlib/array.pyi @@ -35,6 +35,7 @@ class array(MutableSequence[_T], Generic[_T]): def index(self, __v: _T, __start: int = ..., __stop: int = ...) -> int: ... else: def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence + def insert(self, __i: int, __v: _T) -> None: ... def pop(self, __i: int = ...) -> _T: ... def remove(self, __v: _T) -> None: ... @@ -46,6 +47,7 @@ class array(MutableSequence[_T], Generic[_T]): if sys.version_info < (3, 9): def fromstring(self, __buffer: bytes) -> None: ... def tostring(self) -> bytes: ... + def __len__(self) -> int: ... @overload def __getitem__(self, __i: SupportsIndex) -> _T: ... diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index 8494a3a99..5a86d6888 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -15,14 +15,17 @@ from typing_extensions import Literal if sys.version_info >= (3, 8): class Num(Constant): value: complex + class Str(Constant): value: str # Aliases for value, for backwards compatibility s: str + class Bytes(Constant): value: bytes # Aliases for value, for backwards compatibility s: bytes + class NameConstant(Constant): ... class Ellipsis(Constant): ... @@ -88,6 +91,7 @@ class NodeVisitor: def visit_Constant(self, node: Constant) -> Any: ... if sys.version_info >= (3, 8): def visit_NamedExpr(self, node: NamedExpr) -> Any: ... + def visit_Attribute(self, node: Attribute) -> Any: ... def visit_Subscript(self, node: Subscript) -> Any: ... def visit_Starred(self, node: Starred) -> Any: ... diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index bcc5a15d9..559004683 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -69,6 +69,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def time(self) -> float: ... # Future methods def create_future(self) -> Future[Any]: ... @@ -77,6 +78,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): def create_task(self, coro: Awaitable[_T] | Generator[Any, None, _T], *, name: object = ...) -> Task[_T]: ... else: def create_task(self, coro: Awaitable[_T] | Generator[Any, None, _T]) -> Task[_T]: ... + def set_task_factory(self, factory: Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]] | None) -> None: ... def get_task_factory(self) -> Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]] | None: ... # Methods for interacting with threads @@ -84,6 +86,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... else: def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ... def set_default_executor(self, executor: Any) -> None: ... # Network I/O methods returning Futures. diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 89861a815..ccd5ca1f6 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -32,6 +32,7 @@ class Handle: ) -> None: ... else: def __init__(self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ... + def cancel(self) -> None: ... def _run(self) -> None: ... if sys.version_info >= (3, 7): @@ -49,6 +50,7 @@ class TimerHandle(Handle): ) -> None: ... else: def __init__(self, when: float, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ... + def __hash__(self) -> int: ... if sys.version_info >= (3, 7): def when(self) -> float: ... @@ -62,6 +64,7 @@ class AbstractServer: def is_serving(self) -> bool: ... async def start_serving(self) -> None: ... async def serve_forever(self) -> None: ... + async def wait_closed(self) -> None: ... class AbstractEventLoop(metaclass=ABCMeta): @@ -104,6 +107,7 @@ class AbstractEventLoop(metaclass=ABCMeta): else: @abstractmethod def create_task(self, coro: Awaitable[_T] | Generator[Any, None, _T]) -> Task[_T]: ... + @abstractmethod def set_task_factory(self, factory: Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]] | None) -> None: ... @abstractmethod @@ -357,6 +361,7 @@ class AbstractEventLoop(metaclass=ABCMeta): backlog: int = ..., ssl: _SSLContext = ..., ) -> Server: ... + @abstractmethod async def create_datagram_endpoint( self, diff --git a/stdlib/asyncio/futures.pyi b/stdlib/asyncio/futures.pyi index d9cfccbc7..a3caa670e 100644 --- a/stdlib/asyncio/futures.pyi +++ b/stdlib/asyncio/futures.pyi @@ -6,6 +6,7 @@ from .events import AbstractEventLoop if sys.version_info < (3, 8): from concurrent.futures import CancelledError as CancelledError, TimeoutError as TimeoutError + class InvalidStateError(Error): ... if sys.version_info >= (3, 7): @@ -48,6 +49,7 @@ class Future(Awaitable[_T], Iterable[_T]): def cancel(self, msg: Any | None = ...) -> bool: ... else: def cancel(self) -> bool: ... + def cancelled(self) -> bool: ... def done(self) -> bool: ... def result(self) -> _T: ... diff --git a/stdlib/asyncio/locks.pyi b/stdlib/asyncio/locks.pyi index fa1b9235a..e9e840371 100644 --- a/stdlib/asyncio/locks.pyi +++ b/stdlib/asyncio/locks.pyi @@ -21,6 +21,7 @@ else: def __init__(self, lock: Lock | Semaphore) -> None: ... def __enter__(self) -> object: ... def __exit__(self, *args: Any) -> None: ... + class _ContextManagerMixin: def __init__(self, lock: Lock | Semaphore) -> None: ... # Apparently this exists to *prohibit* use as a context manager. diff --git a/stdlib/asyncio/proactor_events.pyi b/stdlib/asyncio/proactor_events.pyi index 64c65d847..eba158267 100644 --- a/stdlib/asyncio/proactor_events.pyi +++ b/stdlib/asyncio/proactor_events.pyi @@ -25,6 +25,7 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTr def __del__(self, _warn: _WarnCallbackProtocol = ...) -> None: ... else: def __del__(self) -> None: ... + def get_write_buffer_size(self) -> int: ... class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTransport): diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index 082e96dc0..4ecd7a11d 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -57,6 +57,7 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport): def close(self) -> None: ... if sys.version_info >= (3, 7): def is_reading(self) -> bool: ... + def pause_reading(self) -> None: ... def resume_reading(self) -> None: ... def set_write_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ... @@ -64,6 +65,7 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport): if sys.version_info >= (3, 7): @property def _protocol_paused(self) -> bool: ... + def write(self, data: bytes) -> None: ... def can_write_eof(self) -> Literal[False]: ... def abort(self) -> None: ... @@ -114,6 +116,7 @@ class SSLProtocol(protocols.Protocol): ) -> None: ... if sys.version_info >= (3, 7): def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ... + def _wakeup_waiter(self, exc: BaseException | None = ...) -> None: ... def connection_made(self, transport: transports.BaseTransport) -> None: ... def connection_lost(self, exc: BaseException | None) -> None: ... @@ -127,6 +130,7 @@ class SSLProtocol(protocols.Protocol): def _start_handshake(self) -> None: ... if sys.version_info >= (3, 7): def _check_handshake_timeout(self) -> None: ... + def _on_handshake_complete(self, handshake_exc: BaseException | None) -> None: ... def _process_write_backlog(self) -> None: ... def _fatal_error(self, exc: BaseException, message: str = ...) -> None: ... diff --git a/stdlib/asyncio/streams.pyi b/stdlib/asyncio/streams.pyi index 928631ec9..edf37b509 100644 --- a/stdlib/asyncio/streams.pyi +++ b/stdlib/asyncio/streams.pyi @@ -12,6 +12,7 @@ if sys.version_info < (3, 8): expected: int | None partial: bytes def __init__(self, partial: bytes, expected: int | None) -> None: ... + class LimitOverrunError(Exception): consumed: int def __init__(self, message: str, consumed: int) -> None: ... @@ -114,6 +115,7 @@ class StreamWriter: if sys.version_info >= (3, 7): def is_closing(self) -> bool: ... async def wait_closed(self) -> None: ... + def get_extra_info(self, name: str, default: Any = ...) -> Any: ... async def drain(self) -> None: ... diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index c1c073895..b78daf1f9 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -269,6 +269,7 @@ class Task(Future[_T], Generic[_T]): def get_coro(self) -> Generator[_TaskYieldType, None, _T] | Awaitable[_T]: ... def get_name(self) -> str: ... def set_name(self, __value: object) -> None: ... + def get_stack(self, *, limit: int | None = ...) -> list[FrameType]: ... def print_stack(self, *, limit: int | None = ..., file: TextIO | None = ...) -> None: ... if sys.version_info >= (3, 9): @@ -291,6 +292,7 @@ if sys.version_info >= (3, 7): def create_task(coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T], *, name: str | None = ...) -> Task[_T]: ... else: def create_task(coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T]) -> Task[_T]: ... + def current_task(loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ... def _enter_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ... def _leave_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ... diff --git a/stdlib/asyncio/transports.pyi b/stdlib/asyncio/transports.pyi index acca0e4c2..e63e1e472 100644 --- a/stdlib/asyncio/transports.pyi +++ b/stdlib/asyncio/transports.pyi @@ -15,6 +15,7 @@ class BaseTransport: class ReadTransport(BaseTransport): if sys.version_info >= (3, 7): def is_reading(self) -> bool: ... + def pause_reading(self) -> None: ... def resume_reading(self) -> None: ... diff --git a/stdlib/asyncio/trsock.pyi b/stdlib/asyncio/trsock.pyi index 6d4b7378b..acd822ce7 100644 --- a/stdlib/asyncio/trsock.pyi +++ b/stdlib/asyncio/trsock.pyi @@ -43,6 +43,7 @@ class TransportSocket: def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> None: ... else: def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> NoReturn: ... + def listen(self, __backlog: int = ...) -> None: ... def makefile(self) -> BinaryIO: ... def sendfile(self, file: BinaryIO, offset: int = ..., count: int | None = ...) -> int: ... @@ -56,6 +57,7 @@ class TransportSocket: def sendmsg_afalg( self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... ) -> NoReturn: ... + def sendmsg( self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., __flags: int = ..., __address: _Address = ... ) -> int: ... @@ -70,6 +72,7 @@ class TransportSocket: def share(self, process_id: int) -> bytes: ... else: def share(self, process_id: int) -> NoReturn: ... + 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( diff --git a/stdlib/asyncio/unix_events.pyi b/stdlib/asyncio/unix_events.pyi index d4c1c546d..64fecc6b5 100644 --- a/stdlib/asyncio/unix_events.pyi +++ b/stdlib/asyncio/unix_events.pyi @@ -24,10 +24,13 @@ class AbstractChildWatcher: if sys.platform != "win32": class BaseChildWatcher(AbstractChildWatcher): def __init__(self) -> None: ... + class SafeChildWatcher(BaseChildWatcher): def __enter__(self: Self) -> Self: ... + class FastChildWatcher(BaseChildWatcher): def __enter__(self: Self) -> Self: ... + class _UnixSelectorEventLoop(BaseSelectorEventLoop): if sys.version_info < (3, 7): async def create_unix_server( @@ -39,6 +42,7 @@ if sys.platform != "win32": backlog: int = ..., ssl: _SSLContext = ..., ) -> Server: ... + class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy): def get_child_watcher(self) -> AbstractChildWatcher: ... def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ... @@ -49,12 +53,15 @@ if sys.platform != "win32": if sys.version_info >= (3, 8): from typing import Protocol + class _Warn(Protocol): def __call__( self, message: str, category: type[Warning] | None = ..., stacklevel: int = ..., source: Any | None = ... ) -> None: ... + class MultiLoopChildWatcher(AbstractChildWatcher): def __enter__(self: Self) -> Self: ... + class ThreadedChildWatcher(AbstractChildWatcher): def __enter__(self: Self) -> Self: ... def __del__(self, _warn: _Warn = ...) -> None: ... diff --git a/stdlib/asyncio/windows_events.pyi b/stdlib/asyncio/windows_events.pyi index e43a0eda8..1e4d28638 100644 --- a/stdlib/asyncio/windows_events.pyi +++ b/stdlib/asyncio/windows_events.pyi @@ -25,12 +25,15 @@ if sys.platform == "win32": ERROR_CONNECTION_ABORTED: Literal[1236] CONNECT_PIPE_INIT_DELAY: float CONNECT_PIPE_MAX_DELAY: float + class PipeServer: def __init__(self, address: str) -> None: ... def __del__(self) -> None: ... def closed(self) -> bool: ... def close(self) -> None: ... + class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ... + class ProactorEventLoop(proactor_events.BaseProactorEventLoop): def __init__(self, proactor: IocpProactor | None = ...) -> None: ... async def create_pipe_connection( @@ -39,6 +42,7 @@ if sys.platform == "win32": async def start_serving_pipe( self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str ) -> list[PipeServer]: ... + class IocpProactor: def __init__(self, concurrency: int = ...) -> None: ... def __del__(self) -> None: ... @@ -47,11 +51,13 @@ if sys.platform == "win32": def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ... if sys.version_info >= (3, 7): def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... + def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... def accept(self, listener: socket.socket) -> futures.Future[Any]: ... def connect(self, conn: socket.socket, address: bytes) -> futures.Future[Any]: ... if sys.version_info >= (3, 7): def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... + def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... async def connect_pipe(self, address: bytes) -> windows_utils.PipeHandle: ... def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = ...) -> bool: ... @@ -63,6 +69,7 @@ if sys.platform == "win32": _loop_factory: ClassVar[type[SelectorEventLoop]] def get_child_watcher(self) -> NoReturn: ... def set_child_watcher(self, watcher: Any) -> NoReturn: ... + class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): _loop_factory: ClassVar[type[ProactorEventLoop]] def get_child_watcher(self) -> NoReturn: ... diff --git a/stdlib/asyncio/windows_utils.pyi b/stdlib/asyncio/windows_utils.pyi index 3c96b76fc..f9d5f230c 100644 --- a/stdlib/asyncio/windows_utils.pyi +++ b/stdlib/asyncio/windows_utils.pyi @@ -14,12 +14,14 @@ if sys.platform == "win32": PIPE = subprocess.PIPE STDOUT = subprocess.STDOUT def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ... + class PipeHandle: def __init__(self, handle: int) -> None: ... if sys.version_info >= (3, 8): def __del__(self, _warn: _WarnFunction = ...) -> None: ... else: def __del__(self) -> None: ... + def __enter__(self: Self) -> Self: ... def __exit__(self, t: type | None, v: BaseException | None, tb: TracebackType | None) -> None: ... @property diff --git a/stdlib/asyncore.pyi b/stdlib/asyncore.pyi index 123da2677..8f77e0e45 100644 --- a/stdlib/asyncore.pyi +++ b/stdlib/asyncore.pyi @@ -85,6 +85,7 @@ if sys.platform != "win32": def write(self, data: bytes, flags: int = ...) -> int: ... def close(self) -> None: ... def fileno(self) -> int: ... + class file_dispatcher(dispatcher): def __init__(self, fd: FileDescriptorLike, map: _maptype | None = ...) -> None: ... def set_file(self, fd: int) -> None: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index e02398ee3..81a7773ba 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -108,6 +108,7 @@ class object: def __reduce_ex__(self, __protocol: SupportsIndex) -> str | tuple[Any, ...]: ... else: def __reduce_ex__(self, __protocol: int) -> str | tuple[Any, ...]: ... + def __dir__(self) -> Iterable[str]: ... def __init_subclass__(cls) -> None: ... @@ -185,6 +186,7 @@ class int: def __new__(cls: type[Self], __x: str | bytes | bytearray, base: SupportsIndex) -> Self: ... if sys.version_info >= (3, 8): def as_integer_ratio(self) -> tuple[int, Literal[1]]: ... + @property def real(self) -> int: ... @property @@ -197,6 +199,7 @@ class int: def bit_length(self) -> int: ... if sys.version_info >= (3, 10): def bit_count(self) -> int: ... + def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ... @classmethod def from_bytes( @@ -303,6 +306,7 @@ class float: if sys.version_info >= (3, 9): def __ceil__(self) -> int: ... def __floor__(self) -> int: ... + @overload def __round__(self, __ndigits: None = ...) -> int: ... @overload @@ -371,6 +375,7 @@ class str(Sequence[str]): def expandtabs(self, tabsize: SupportsIndex = ...) -> str: ... else: def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... def format(self, *args: object, **kwargs: object) -> str: ... def format_map(self, map: _FormatMapMapping) -> str: ... @@ -379,6 +384,7 @@ class str(Sequence[str]): def isalpha(self) -> bool: ... if sys.version_info >= (3, 7): def isascii(self) -> bool: ... + def isdecimal(self) -> bool: ... def isdigit(self) -> bool: ... def isidentifier(self) -> bool: ... @@ -397,6 +403,7 @@ class str(Sequence[str]): if sys.version_info >= (3, 9): def removeprefix(self, __prefix: str) -> str: ... def removesuffix(self, __suffix: str) -> str: ... + def rfind(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... def rjust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ... @@ -462,6 +469,7 @@ class bytes(ByteString): def expandtabs(self, tabsize: SupportsIndex = ...) -> bytes: ... else: def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find( self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... @@ -469,6 +477,7 @@ class bytes(ByteString): def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ... else: def hex(self) -> str: ... + def index( self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... @@ -476,6 +485,7 @@ class bytes(ByteString): def isalpha(self) -> bool: ... if sys.version_info >= (3, 7): def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... def islower(self) -> bool: ... def isspace(self) -> bool: ... @@ -490,6 +500,7 @@ class bytes(ByteString): if sys.version_info >= (3, 9): def removeprefix(self, __prefix: bytes) -> bytes: ... def removesuffix(self, __suffix: bytes) -> bytes: ... + def rfind( self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... @@ -562,6 +573,7 @@ class bytearray(MutableSequence[int], ByteString): def expandtabs(self, tabsize: SupportsIndex = ...) -> bytearray: ... else: def expandtabs(self, tabsize: int = ...) -> bytearray: ... + def extend(self, __iterable_of_ints: Iterable[SupportsIndex]) -> None: ... def find( self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... @@ -570,6 +582,7 @@ class bytearray(MutableSequence[int], ByteString): def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ... else: def hex(self) -> str: ... + def index( self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... @@ -578,6 +591,7 @@ class bytearray(MutableSequence[int], ByteString): def isalpha(self) -> bool: ... if sys.version_info >= (3, 7): def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... def islower(self) -> bool: ... def isspace(self) -> bool: ... @@ -591,6 +605,7 @@ class bytearray(MutableSequence[int], ByteString): if sys.version_info >= (3, 9): def removeprefix(self, __prefix: bytes) -> bytearray: ... def removesuffix(self, __suffix: bytes) -> bytearray: ... + def replace(self, __old: bytes, __new: bytes, __count: SupportsIndex = ...) -> bytearray: ... def rfind( self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... @@ -691,9 +706,11 @@ class memoryview(Sized, Sequence[int]): def tobytes(self, order: Literal["C", "F", "A"] | None = ...) -> bytes: ... else: def tobytes(self) -> bytes: ... + def tolist(self) -> list[int]: ... if sys.version_info >= (3, 8): def toreadonly(self) -> memoryview: ... + def release(self) -> None: ... if sys.version_info >= (3, 8): def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ... @@ -1506,6 +1523,7 @@ class zip(Iterator[_T_co], Generic[_T_co]): __iter6: Iterable[Any], *iterables: Iterable[Any], ) -> zip[tuple[Any, ...]]: ... + def __iter__(self) -> Iterator[_T_co]: ... def __next__(self) -> _T_co: ... @@ -1679,6 +1697,7 @@ if sys.version_info >= (3, 10): if sys.version_info >= (3, 11): _SplitCondition = type[BaseException] | tuple[type[BaseException], ...] | Callable[[BaseException], bool] + class BaseExceptionGroup(BaseException): def __new__(cls, __message: str, __exceptions: Sequence[BaseException]) -> BaseExceptionGroup | ExceptionGroup: ... @property @@ -1688,6 +1707,7 @@ if sys.version_info >= (3, 11): def subgroup(self: Self, __condition: _SplitCondition) -> Self | None: ... def split(self: Self, __condition: _SplitCondition) -> tuple[Self | None, Self | None]: ... def derive(self: Self, __excs: Sequence[BaseException]) -> Self: ... + class ExceptionGroup(BaseExceptionGroup, Exception): def __new__(cls, __message: str, __exceptions: Sequence[Exception]) -> ExceptionGroup: ... @property diff --git a/stdlib/bz2.pyi b/stdlib/bz2.pyi index 69f13e496..6bc18382d 100644 --- a/stdlib/bz2.pyi +++ b/stdlib/bz2.pyi @@ -116,6 +116,7 @@ class BZ2File(BaseStream, IO[bytes]): buffering: Any | None = ..., compresslevel: int = ..., ) -> None: ... + def read(self, size: int | None = ...) -> bytes: ... def read1(self, size: int = ...) -> bytes: ... def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore[override] diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index e2610011f..83355dc3b 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -142,6 +142,7 @@ class UserString(Sequence[str]): def encode(self: UserString, encoding: str | None = ..., errors: str | None = ...) -> bytes: ... else: def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ... + def endswith(self, suffix: str | tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ... def expandtabs(self: Self, tabsize: int = ...) -> Self: ... def find(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ... @@ -161,6 +162,7 @@ class UserString(Sequence[str]): def isupper(self) -> bool: ... if sys.version_info >= (3, 7): def isascii(self) -> bool: ... + def join(self, seq: Iterable[str]) -> str: ... def ljust(self: Self, width: int, *args: Any) -> Self: ... def lower(self: Self) -> Self: ... @@ -175,6 +177,7 @@ class UserString(Sequence[str]): if sys.version_info >= (3, 9): def removeprefix(self: Self, __prefix: str | UserString) -> Self: ... def removesuffix(self: Self, __suffix: str | UserString) -> Self: ... + def replace(self: Self, old: str | UserString, new: str | UserString, maxsplit: int = ...) -> Self: ... def rfind(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ... def rindex(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ... diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 9e2365b49..be8e61177 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -63,6 +63,7 @@ class Executor: 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]: ... + def map( self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = ..., chunksize: int = ... ) -> Iterator[_T]: ... @@ -70,6 +71,7 @@ class Executor: def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ... else: def shutdown(self, wait: bool = ...) -> None: ... + def __enter__(self: Self) -> Self: ... def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool | None: ... diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index 900c46e19..0c6c40394 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -81,6 +81,7 @@ if sys.version_info >= (3, 7): def __init__( self, max_size: int | None = ..., *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]] ) -> None: ... + def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ... def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...], None, None]: ... @@ -130,6 +131,7 @@ def _chain_from_iterable_of_lists(iterable: Iterable[MutableSequence[Any]]) -> A if sys.version_info >= (3, 7): from ._base import BrokenExecutor + class BrokenProcessPool(BrokenExecutor): ... else: @@ -163,4 +165,5 @@ class ProcessPoolExecutor(Executor): def __init__(self, max_workers: int | None = ...) -> None: ... if sys.version_info >= (3, 9): def _start_executor_manager_thread(self) -> None: ... + def _adjust_process_count(self) -> None: ... diff --git a/stdlib/concurrent/futures/thread.pyi b/stdlib/concurrent/futures/thread.pyi index f27c43c34..46ca681c5 100644 --- a/stdlib/concurrent/futures/thread.pyi +++ b/stdlib/concurrent/futures/thread.pyi @@ -41,6 +41,7 @@ else: if sys.version_info >= (3, 7): from ._base import BrokenExecutor + class BrokenThreadPool(BrokenExecutor): ... class ThreadPoolExecutor(Executor): @@ -67,6 +68,7 @@ class ThreadPoolExecutor(Executor): ) -> None: ... else: def __init__(self, max_workers: int | None = ..., thread_name_prefix: str = ...) -> None: ... + def _adjust_thread_count(self) -> None: ... if sys.version_info >= (3, 7): def _initializer_failed(self) -> None: ... diff --git a/stdlib/contextlib.pyi b/stdlib/contextlib.pyi index 418005bc8..206f16666 100644 --- a/stdlib/contextlib.pyi +++ b/stdlib/contextlib.pyi @@ -51,8 +51,10 @@ def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _Generat if sys.version_info >= (3, 10): _AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]]) + class AsyncContextDecorator: def __call__(self, func: _AF) -> _AF: ... + class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], AsyncContextDecorator, Generic[_T_co]): # __init__ and these attributes are actually defined in the base class _GeneratorContextManagerBase, # which is more trouble than it's worth to include in the stub (see #6676) @@ -85,6 +87,7 @@ if sys.version_info >= (3, 10): class _SupportsAclose(Protocol): def aclose(self) -> Awaitable[object]: ... _SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose) + class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]): def __init__(self, thing: _SupportsAcloseT) -> None: ... @@ -115,6 +118,7 @@ class ExitStack(AbstractContextManager[ExitStack]): if sys.version_info >= (3, 7): _ExitCoroFunc = Callable[[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]], Awaitable[bool]] _ACM_EF = TypeVar("_ACM_EF", AbstractAsyncContextManager[Any], _ExitCoroFunc) + class AsyncExitStack(AbstractAsyncContextManager[AsyncExitStack]): def __init__(self) -> None: ... def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ... @@ -156,6 +160,7 @@ elif sys.version_info >= (3, 7): if sys.version_info >= (3, 11): _T_fd_or_any_path = TypeVar("_T_fd_or_any_path", bound=int | StrOrBytesPath) + class chdir(AbstractContextManager[None], Generic[_T_fd_or_any_path]): path: _T_fd_or_any_path def __init__(self, path: _T_fd_or_any_path) -> None: ... diff --git a/stdlib/crypt.pyi b/stdlib/crypt.pyi index a8342859e..5083f1eeb 100644 --- a/stdlib/crypt.pyi +++ b/stdlib/crypt.pyi @@ -15,4 +15,5 @@ if sys.platform != "win32": def mksalt(method: _Method | None = ..., *, rounds: int | None = ...) -> str: ... else: def mksalt(method: _Method | None = ...) -> str: ... + def crypt(word: str, salt: str | _Method | None = ...) -> str: ... diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 4bc21d470..9ad0e2225 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -98,6 +98,7 @@ class DictWriter(Generic[_T]): def writeheader(self) -> Any: ... else: def writeheader(self) -> None: ... + def writerow(self, rowdict: Mapping[_T, Any]) -> Any: ... def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ... diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index 00e1e25cf..e437f459e 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -47,6 +47,7 @@ class CDLL: def __init__( self, name: str | None, mode: int = ..., handle: int | None = ..., use_errno: bool = ..., use_last_error: bool = ... ) -> None: ... + def __getattr__(self, name: str) -> _NamedFuncPointer: ... def __getitem__(self, name: str) -> _NamedFuncPointer: ... diff --git a/stdlib/curses/panel.pyi b/stdlib/curses/panel.pyi index ed13a6e05..30803791f 100644 --- a/stdlib/curses/panel.pyi +++ b/stdlib/curses/panel.pyi @@ -4,6 +4,7 @@ if sys.platform != "win32": from _curses import _CursesWindow version: str + class _Curses_Panel: # type is (note the space in the class name) def above(self) -> _Curses_Panel: ... def below(self) -> _Curses_Panel: ... @@ -17,6 +18,7 @@ if sys.platform != "win32": def top(self) -> None: ... def userptr(self) -> object: ... def window(self) -> _CursesWindow: ... + def bottom_panel() -> _Curses_Panel: ... def new_panel(__win: _CursesWindow) -> _Curses_Panel: ... def top_panel() -> _Curses_Panel: ... diff --git a/stdlib/curses/textpad.pyi b/stdlib/curses/textpad.pyi index eb6879603..b8a9c843f 100644 --- a/stdlib/curses/textpad.pyi +++ b/stdlib/curses/textpad.pyi @@ -4,6 +4,7 @@ from typing import Callable if sys.platform != "win32": from _curses import _CursesWindow def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ... + class Textbox: stripspaces: bool def __init__(self, win: _CursesWindow, insert_mode: bool = ...) -> None: ... diff --git a/stdlib/datetime.pyi b/stdlib/datetime.pyi index 2c6a06739..33fabcf0e 100644 --- a/stdlib/datetime.pyi +++ b/stdlib/datetime.pyi @@ -49,6 +49,7 @@ class date: if sys.version_info >= (3, 8): @classmethod def fromisocalendar(cls: type[Self], year: int, week: int, day: int) -> Self: ... + @property def year(self) -> int: ... @property @@ -85,6 +86,7 @@ class date: def __sub__(self, __other: datetime) -> NoReturn: ... @overload def __sub__(self, __other: date) -> timedelta: ... + def __hash__(self) -> int: ... def weekday(self) -> int: ... def isoweekday(self) -> int: ... @@ -128,6 +130,7 @@ class time: if sys.version_info >= (3, 7): @classmethod def fromisoformat(cls: type[Self], __time_string: str) -> Self: ... + def strftime(self, __format: str) -> str: ... def __format__(self, __fmt: str) -> str: ... def utcoffset(self) -> timedelta | None: ... @@ -240,6 +243,7 @@ class datetime(date): @overload @classmethod def now(cls, tz: _tzinfo) -> datetime: ... + @classmethod def utcnow(cls: type[Self]) -> Self: ... @classmethod @@ -247,6 +251,7 @@ class datetime(date): if sys.version_info >= (3, 7): @classmethod def fromisoformat(cls: type[Self], __date_string: str) -> Self: ... + def timestamp(self) -> float: ... def utctimetuple(self) -> struct_time: ... def date(self) -> _date: ... @@ -269,6 +274,7 @@ class datetime(date): def astimezone(self: Self, tz: _tzinfo | None = ...) -> Self: ... else: def astimezone(self, tz: _tzinfo | None = ...) -> datetime: ... + def ctime(self) -> str: ... def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... @classmethod diff --git a/stdlib/difflib.pyi b/stdlib/difflib.pyi index ad96aa1c9..2bea5f86f 100644 --- a/stdlib/difflib.pyi +++ b/stdlib/difflib.pyi @@ -22,6 +22,7 @@ class SequenceMatcher(Generic[_T]): def find_longest_match(self, alo: int = ..., ahi: int | None = ..., blo: int = ..., bhi: int | None = ...) -> Match: ... else: def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ... + def get_matching_blocks(self) -> list[Match]: ... def get_opcodes(self) -> list[tuple[str, int, int, int, int]]: ... def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[tuple[str, int, int, int, int]]]: ... diff --git a/stdlib/distutils/command/bdist_msi.pyi b/stdlib/distutils/command/bdist_msi.pyi index e4f64ff6a..66202e841 100644 --- a/stdlib/distutils/command/bdist_msi.pyi +++ b/stdlib/distutils/command/bdist_msi.pyi @@ -5,6 +5,7 @@ from ..cmd import Command if sys.platform == "win32": from msilib import Dialog + class PyDialog(Dialog): def __init__(self, *args, **kw) -> None: ... def title(self, title) -> None: ... @@ -12,6 +13,7 @@ if sys.platform == "win32": def cancel(self, title, next, name: str = ..., active: int = ...): ... def next(self, title, next, name: str = ..., active: int = ...): ... def xbutton(self, name, title, next, xpos): ... + class bdist_msi(Command): description: str user_options: Any diff --git a/stdlib/email/_header_value_parser.pyi b/stdlib/email/_header_value_parser.pyi index 1b006c3f7..87018f04e 100644 --- a/stdlib/email/_header_value_parser.pyi +++ b/stdlib/email/_header_value_parser.pyi @@ -312,8 +312,10 @@ if sys.version_info >= (3, 8): token_type: str as_ew_allowed: bool def fold(self, policy: Policy) -> str: ... + class MessageID(MsgID): token_type: str + class InvalidMessageID(MessageID): token_type: str diff --git a/stdlib/email/headerregistry.pyi b/stdlib/email/headerregistry.pyi index b84acab18..1dabf6a4a 100644 --- a/stdlib/email/headerregistry.pyi +++ b/stdlib/email/headerregistry.pyi @@ -132,6 +132,7 @@ class ContentTransferEncodingHeader: if sys.version_info >= (3, 8): from email._header_value_parser import MessageID + class MessageIDHeader: max_count: ClassVar[Literal[1]] @classmethod diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index efc668720..72ea42f36 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -46,6 +46,7 @@ class EnumMeta(ABCMeta): def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> Self: ... # type: ignore else: def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> Self: ... # type: ignore + def __iter__(self: type[_T]) -> Iterator[_T]: ... def __reversed__(self: type[_T]) -> Iterator[_T]: ... def __contains__(self: type[Any], member: object) -> bool: ... @@ -127,6 +128,7 @@ class IntEnum(int, Enum): else: @types.DynamicClassAttribute def value(self) -> int: ... + def __new__(cls: type[Self], value: int | Self) -> Self: ... def unique(enumeration: _S) -> _S: ... @@ -142,6 +144,7 @@ class auto(IntFlag): else: @types.DynamicClassAttribute def value(self) -> Any: ... + def __new__(cls: type[Self]) -> Self: ... class Flag(Enum): @@ -157,6 +160,7 @@ class Flag(Enum): def name(self) -> str | None: ... # type: ignore[override] @types.DynamicClassAttribute def value(self) -> int: ... + def __contains__(self: _T, other: _T) -> bool: ... def __bool__(self) -> bool: ... def __or__(self: Self, other: Self) -> Self: ... @@ -179,6 +183,7 @@ if sys.version_info >= (3, 11): _value_: str @property def value(self) -> str: ... + class FlagBoundary(StrEnum): STRICT: str CONFORM: str @@ -188,6 +193,7 @@ if sys.version_info >= (3, 11): CONFORM = FlagBoundary.CONFORM EJECT = FlagBoundary.EJECT KEEP = FlagBoundary.KEEP + class property(types.DynamicClassAttribute): def __set_name__(self, ownerclass: type[Enum], name: str) -> None: ... name: str diff --git a/stdlib/fileinput.pyi b/stdlib/fileinput.pyi index 04d8ff47d..a1c40508d 100644 --- a/stdlib/fileinput.pyi +++ b/stdlib/fileinput.pyi @@ -79,6 +79,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): mode: str = ..., openhook: Callable[[StrOrBytesPath, str], IO[AnyStr]] = ..., ) -> None: ... + def __del__(self) -> None: ... def close(self) -> None: ... def __enter__(self: Self) -> Self: ... @@ -87,6 +88,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): def __next__(self) -> AnyStr: ... if sys.version_info < (3, 11): def __getitem__(self, i: int) -> AnyStr: ... + def nextfile(self) -> None: ... def readline(self) -> AnyStr: ... def filename(self) -> str: ... diff --git a/stdlib/fractions.pyi b/stdlib/fractions.pyi index 56a6f0c07..f9b98765e 100644 --- a/stdlib/fractions.pyi +++ b/stdlib/fractions.pyi @@ -31,6 +31,7 @@ class Fraction(Rational): def limit_denominator(self, max_denominator: int = ...) -> Fraction: ... if sys.version_info >= (3, 8): def as_integer_ratio(self) -> tuple[int, int]: ... + @property def numerator(self) -> int: ... @property diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index f9df2a0fc..d76251417 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -62,6 +62,7 @@ class FTP: timeout: float = ..., source_address: tuple[str, int] | None = ..., ) -> None: ... + def connect( self, host: str = ..., port: int = ..., timeout: float = ..., source_address: tuple[str, int] | None = ... ) -> str: ... diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 7dcbfb987..ddbbfa3d5 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -106,6 +106,7 @@ if sys.version_info >= (3, 8): @overload def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ... def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + class cached_property(Generic[_T]): func: Callable[[Any], _T] attrname: str | None diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 1a6a9958d..e7893e5fd 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -14,11 +14,13 @@ class NullTranslations: if sys.version_info >= (3, 8): def pgettext(self, context: str, message: str) -> str: ... def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ... + def info(self) -> Any: ... def charset(self) -> Any: ... if sys.version_info < (3, 11): def output_charset(self) -> Any: ... def set_output_charset(self, charset: str) -> None: ... + def install(self, names: Container[str] | None = ...) -> None: ... class GNUTranslations(NullTranslations): diff --git a/stdlib/grp.pyi b/stdlib/grp.pyi index b41626992..732c36b3d 100644 --- a/stdlib/grp.pyi +++ b/stdlib/grp.pyi @@ -14,6 +14,7 @@ if sys.platform != "win32": def gr_gid(self) -> int: ... @property def gr_mem(self) -> list[str]: ... + def getgrall() -> list[struct_group]: ... def getgrgid(id: int) -> struct_group: ... def getgrnam(name: str) -> struct_group: ... diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index 158a04c21..071c49470 100644 --- a/stdlib/http/client.pyi +++ b/stdlib/http/client.pyi @@ -153,6 +153,7 @@ class HTTPConnection: def __init__( self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: tuple[str, int] | None = ... ) -> None: ... + def request( self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ... ) -> None: ... diff --git a/stdlib/http/cookiejar.pyi b/stdlib/http/cookiejar.pyi index 1b4deb9b2..02fadd873 100644 --- a/stdlib/http/cookiejar.pyi +++ b/stdlib/http/cookiejar.pyi @@ -35,6 +35,7 @@ class FileCookieJar(CookieJar): def __init__(self, filename: StrPath | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ... else: def __init__(self, filename: str | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ... + def save(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... def load(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... def revert(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... @@ -100,6 +101,7 @@ class DefaultCookiePolicy(CookiePolicy): strict_ns_set_initial_dollar: bool = ..., strict_ns_set_path: bool = ..., ) -> None: ... + def blocked_domains(self) -> tuple[str, ...]: ... def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ... def is_blocked(self, domain: str) -> bool: ... diff --git a/stdlib/http/cookies.pyi b/stdlib/http/cookies.pyi index 211fd3766..95a4716a8 100644 --- a/stdlib/http/cookies.pyi +++ b/stdlib/http/cookies.pyi @@ -27,6 +27,7 @@ class Morsel(dict[str, Any], Generic[_T]): def set(self, key: str, val: str, coded_val: _T) -> None: ... else: def set(self, key: str, val: str, coded_val: _T, LegalChars: str = ...) -> None: ... + def setdefault(self, key: str, val: str | None = ...) -> str: ... # The dict update can also get a keywords argument so this is incompatible @overload # type: ignore[override] diff --git a/stdlib/http/server.pyi b/stdlib/http/server.pyi index e3d0a8c31..df9561ce5 100644 --- a/stdlib/http/server.pyi +++ b/stdlib/http/server.pyi @@ -60,6 +60,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): ) -> None: ... else: def __init__(self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer) -> None: ... + def do_GET(self) -> None: ... def do_HEAD(self) -> None: ... def send_head(self) -> io.BytesIO | BinaryIO | None: ... # undocumented diff --git a/stdlib/imaplib.pyi b/stdlib/imaplib.pyi index f0ae1a60f..c36e5cee4 100644 --- a/stdlib/imaplib.pyi +++ b/stdlib/imaplib.pyi @@ -40,6 +40,7 @@ class IMAP4: else: def __init__(self, host: str = ..., port: int = ...) -> None: ... def open(self, host: str = ..., port: int = ...) -> None: ... + def __getattr__(self, attr: str) -> Any: ... host: str port: int @@ -96,6 +97,7 @@ class IMAP4: def unsubscribe(self, mailbox: str) -> _CommandResults: ... if sys.version_info >= (3, 9): def unselect(self) -> _CommandResults: ... + def xatom(self, name: str, *args: str) -> _CommandResults: ... def print_log(self) -> None: ... @@ -130,6 +132,7 @@ class IMAP4_SSL(IMAP4): def open(self, host: str = ..., port: int | None = ..., timeout: float | None = ...) -> None: ... else: def open(self, host: str = ..., port: int | None = ...) -> None: ... + def read(self, size: int) -> bytes: ... def readline(self) -> bytes: ... def send(self, data: bytes) -> None: ... @@ -151,6 +154,7 @@ class IMAP4_stream(IMAP4): def open(self, host: str | None = ..., port: int | None = ..., timeout: float | None = ...) -> None: ... else: def open(self, host: str | None = ..., port: int | None = ...) -> None: ... + def read(self, size: int) -> bytes: ... def readline(self) -> bytes: ... def send(self, data: bytes) -> None: ... diff --git a/stdlib/importlib/abc.pyi b/stdlib/importlib/abc.pyi index 9bb370dfd..1ff815858 100644 --- a/stdlib/importlib/abc.pyi +++ b/stdlib/importlib/abc.pyi @@ -91,6 +91,7 @@ if sys.version_info >= (3, 7): else: @abstractmethod def is_resource(self, name: str) -> bool: ... + @abstractmethod def contents(self) -> Iterator[str]: ... @@ -173,6 +174,7 @@ if sys.version_info >= (3, 9): def read_bytes(self) -> bytes: ... @abstractmethod def read_text(self, encoding: str | None = ...) -> str: ... + class TraversableResources(ResourceReader): @abstractmethod def files(self) -> Traversable: ... diff --git a/stdlib/importlib/machinery.pyi b/stdlib/importlib/machinery.pyi index 71a8d61cf..1d7c21444 100644 --- a/stdlib/importlib/machinery.pyi +++ b/stdlib/importlib/machinery.pyi @@ -82,6 +82,7 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): else: @classmethod def create_module(cls, spec: ModuleSpec) -> types.ModuleType | None: ... + @staticmethod def exec_module(module: types.ModuleType) -> None: ... @@ -106,6 +107,7 @@ class PathFinder: elif sys.version_info >= (3, 8): @classmethod def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... + @classmethod def find_spec( cls, fullname: str, path: Sequence[bytes | str] | None = ..., target: types.ModuleType | None = ... diff --git a/stdlib/importlib/metadata/__init__.pyi b/stdlib/importlib/metadata/__init__.pyi index a9e223149..f356760aa 100644 --- a/stdlib/importlib/metadata/__init__.pyi +++ b/stdlib/importlib/metadata/__init__.pyi @@ -15,10 +15,12 @@ if sys.version_info >= (3, 10): if sys.version_info >= (3, 8): class PackageNotFoundError(ModuleNotFoundError): ... + class _EntryPointBase(NamedTuple): name: str value: str group: str + class EntryPoint(_EntryPointBase): pattern: ClassVar[Pattern[str]] def load(self) -> Any: ... # Callable[[], Any] or an importable module @@ -32,6 +34,7 @@ if sys.version_info >= (3, 8): if sys.version_info >= (3, 10): dist: ClassVar[Distribution | None] def matches(self, **params: Any) -> bool: ... # undocumented + class PackagePath(pathlib.PurePosixPath): def read_text(self, encoding: str = ...) -> str: ... def read_binary(self) -> bytes: ... @@ -40,10 +43,12 @@ if sys.version_info >= (3, 8): hash: FileHash | None size: int | None dist: Distribution + class FileHash: mode: str value: str def __init__(self, spec: str) -> None: ... + class Distribution: @abc.abstractmethod def read_text(self, filename: str) -> str | None: ... @@ -74,24 +79,29 @@ if sys.version_info >= (3, 8): if sys.version_info >= (3, 10): @property def name(self) -> str: ... + class DistributionFinder(MetaPathFinder): class Context: name: str | None def __init__(self, *, name: str | None = ..., path: list[str] = ..., **kwargs: Any) -> None: ... @property def path(self) -> list[str]: ... + @abc.abstractmethod def find_distributions(self, context: DistributionFinder.Context = ...) -> Iterable[Distribution]: ... + class MetadataPathFinder(DistributionFinder): @classmethod def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... if sys.version_info >= (3, 10): # Yes, this is an instance method that has argumend named "cls" def invalidate_caches(cls) -> None: ... # type: ignore + class PathDistribution(Distribution): def __init__(self, path: Path) -> None: ... def read_text(self, filename: StrPath) -> str: ... def locate_file(self, path: StrPath) -> PathLike[str]: ... + def distribution(distribution_name: str) -> Distribution: ... @overload def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ... diff --git a/stdlib/ipaddress.pyi b/stdlib/ipaddress.pyi index b703e9570..cc0154f08 100644 --- a/stdlib/ipaddress.pyi +++ b/stdlib/ipaddress.pyi @@ -90,6 +90,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): if sys.version_info >= (3, 7): def subnet_of(self: Self, other: Self) -> bool: ... def supernet_of(self: Self, other: Self) -> bool: ... + def subnets(self: Self, prefixlen_diff: int = ..., new_prefix: int | None = ...) -> Iterator[Self]: ... def supernet(self: Self, prefixlen_diff: int = ..., new_prefix: int | None = ...) -> Self: ... @property diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 30b589770..452d8ae54 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -58,6 +58,7 @@ class accumulate(Iterator[_T], Generic[_T]): def __init__(self, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = ...) -> None: ... else: def __init__(self, iterable: Iterable[_T], func: Callable[[_T, _T], _T] | None = ...) -> None: ... + def __iter__(self) -> Iterator[_T]: ... def __next__(self) -> _T: ... diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index 08a785eb4..dd746427d 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -227,6 +227,7 @@ class Logger(Filterer): def findCaller(self, stack_info: bool = ..., stacklevel: int = ...) -> tuple[str, int, str, str | None]: ... else: def findCaller(self, stack_info: bool = ...) -> tuple[str, int, str, str | None]: ... + def handle(self, record: LogRecord) -> None: ... def makeRecord( self, @@ -301,6 +302,7 @@ class Formatter: ) -> None: ... else: def __init__(self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ...) -> None: ... + def format(self, record: LogRecord) -> str: ... def formatTime(self, record: LogRecord, datefmt: str | None = ...) -> str: ... def formatException(self, ei: _SysExcInfoType) -> str: ... @@ -372,6 +374,7 @@ class LoggerAdapter(Generic[_L]): else: extra: Mapping[str, object] def __init__(self, logger: _L, extra: Mapping[str, object]) -> None: ... + def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> tuple[Any, MutableMapping[str, Any]]: ... if sys.version_info >= (3, 8): def debug( @@ -529,6 +532,7 @@ class LoggerAdapter(Generic[_L]): extra: Mapping[str, object] | None = ..., **kwargs: object, ) -> None: ... + def isEnabledFor(self, level: int) -> bool: ... def getEffectiveLevel(self) -> int: ... def setLevel(self, level: _Level) -> None: ... @@ -733,6 +737,7 @@ class FileHandler(StreamHandler[TextIOWrapper]): ) -> None: ... else: def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def _open(self) -> TextIOWrapper: ... # undocumented class NullHandler(Handler): ... @@ -760,9 +765,11 @@ class PercentStyle: # undocumented def __init__(self, fmt: str, *, defaults: Mapping[str, Any] | None = ...) -> None: ... else: def __init__(self, fmt: str) -> None: ... + def usesTime(self) -> bool: ... if sys.version_info >= (3, 8): def validate(self) -> None: ... + def format(self, record: Any) -> str: ... class StrFormatStyle(PercentStyle): # undocumented diff --git a/stdlib/logging/handlers.pyi b/stdlib/logging/handlers.pyi index 7cd971f61..06cddd94f 100644 --- a/stdlib/logging/handlers.pyi +++ b/stdlib/logging/handlers.pyi @@ -29,6 +29,7 @@ class WatchedFileHandler(FileHandler): ) -> None: ... else: def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def _statstream(self) -> None: ... # undocumented def reopenIfNeeded(self) -> None: ... @@ -41,6 +42,7 @@ class BaseRotatingHandler(FileHandler): ) -> None: ... else: def __init__(self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ...) -> None: ... + def rotation_filename(self, default_name: str) -> str: ... def rotate(self, source: str, dest: str) -> None: ... @@ -68,6 +70,7 @@ class RotatingFileHandler(BaseRotatingHandler): encoding: str | None = ..., delay: bool = ..., ) -> None: ... + def doRollover(self) -> None: ... def shouldRollover(self, record: LogRecord) -> int: ... # undocumented @@ -106,6 +109,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler): utc: bool = ..., atTime: datetime.datetime | None = ..., ) -> None: ... + def doRollover(self) -> None: ... def shouldRollover(self, record: LogRecord) -> int: ... # undocumented def computeRollover(self, currentTime: int) -> int: ... # undocumented @@ -250,6 +254,7 @@ class QueueHandler(Handler): else: queue: Queue[Any] # undocumented def __init__(self, queue: Queue[Any]) -> None: ... + def prepare(self, record: LogRecord) -> Any: ... def enqueue(self, record: LogRecord) -> None: ... @@ -264,6 +269,7 @@ class QueueListener: else: queue: Queue[Any] # undocumented def __init__(self, queue: Queue[Any], *handlers: Handler, respect_handler_level: bool = ...) -> None: ... + def dequeue(self, block: bool) -> LogRecord: ... def prepare(self, record: LogRecord) -> Any: ... def start(self) -> None: ... diff --git a/stdlib/mimetypes.pyi b/stdlib/mimetypes.pyi index 8f51c1580..5b5d07830 100644 --- a/stdlib/mimetypes.pyi +++ b/stdlib/mimetypes.pyi @@ -32,6 +32,7 @@ class MimeTypes: def guess_type(self, url: StrPath, strict: bool = ...) -> tuple[str | None, str | None]: ... else: def guess_type(self, url: str, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_all_extensions(self, type: str, strict: bool = ...) -> list[str]: ... def read(self, filename: str, strict: bool = ...) -> None: ... def readfp(self, fp: IO[str], strict: bool = ...) -> None: ... diff --git a/stdlib/mmap.pyi b/stdlib/mmap.pyi index e59f97320..1f44651dd 100644 --- a/stdlib/mmap.pyi +++ b/stdlib/mmap.pyi @@ -34,11 +34,13 @@ class mmap(AbstractContextManager[mmap], Iterable[int], Sized): def __init__( self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ... ) -> None: ... + def close(self) -> None: ... if sys.version_info >= (3, 8): def flush(self, offset: int = ..., size: int = ...) -> None: ... else: def flush(self, offset: int = ..., size: int = ...) -> int: ... + def move(self, dest: int, src: int, count: int) -> None: ... def read_byte(self) -> int: ... def readline(self) -> bytes: ... @@ -51,6 +53,7 @@ class mmap(AbstractContextManager[mmap], Iterable[int], Sized): closed: bool if sys.version_info >= (3, 8) and sys.platform != "win32": def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ... + def find(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ... def rfind(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ... def read(self, n: int | None = ...) -> bytes: ... diff --git a/stdlib/modulefinder.pyi b/stdlib/modulefinder.pyi index 4a1783efe..9efe032cf 100644 --- a/stdlib/modulefinder.pyi +++ b/stdlib/modulefinder.pyi @@ -46,6 +46,7 @@ class ModuleFinder: excludes: Container[str] = ..., replace_paths: Sequence[tuple[str, str]] = ..., ) -> None: ... + def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented def msgin(self, *args: Any) -> None: ... # undocumented def msgout(self, *args: Any) -> None: ... # undocumented diff --git a/stdlib/msilib/__init__.pyi b/stdlib/msilib/__init__.pyi index ba94e861f..db6f27126 100644 --- a/stdlib/msilib/__init__.pyi +++ b/stdlib/msilib/__init__.pyi @@ -22,6 +22,7 @@ if sys.platform == "win32": type_nullable: Literal[0x1000] type_key: Literal[0x2000] knownbits: Literal[0x3FFF] + class Table: name: str @@ -30,7 +31,9 @@ if sys.platform == "win32": def add_field(self, index: int, name: str, type: int) -> None: ... def sql(self) -> str: ... def create(self, db: _Database) -> None: ... + class _Unspecified: ... + def change_sequence( seq: Sequence[tuple[str, str | None, int]], action: str, @@ -45,6 +48,7 @@ if sys.platform == "win32": def add_tables(db: _Database, module: ModuleType) -> None: ... def make_id(str: str) -> str: ... def gen_uuid() -> str: ... + class CAB: name: str @@ -56,6 +60,7 @@ if sys.platform == "win32": def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ... def commit(self, db: _Database) -> None: ... _directories: set[str] + class Directory: db: _Database @@ -91,10 +96,12 @@ if sys.platform == "win32": def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ... def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ... def remove_pyc(self) -> None: ... + class Binary: name: str def __init__(self, fname: str) -> None: ... + class Feature: id: str @@ -111,6 +118,7 @@ if sys.platform == "win32": attributes: int = ..., ) -> None: ... def set_current(self) -> None: ... + class Control: dlg: Dialog @@ -119,12 +127,14 @@ if sys.platform == "win32": def event(self, event: str, argument: str, condition: str = ..., ordering: int | None = ...) -> None: ... def mapping(self, event: str, attribute: str) -> None: ... def condition(self, action: str, condition: str) -> None: ... + class RadioButtonGroup(Control): property: str index: int def __init__(self, dlg: Dialog, name: str, property: str) -> None: ... def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = ...) -> None: ... + class Dialog: db: _Database diff --git a/stdlib/multiprocessing/connection.pyi b/stdlib/multiprocessing/connection.pyi index 40630d66f..d89821476 100644 --- a/stdlib/multiprocessing/connection.pyi +++ b/stdlib/multiprocessing/connection.pyi @@ -15,6 +15,7 @@ class _ConnectionBase: def __init__(self, handle: SupportsIndex, readable: bool = ..., writable: bool = ...) -> None: ... else: def __init__(self, handle: int, readable: bool = ..., writable: bool = ...) -> None: ... + @property def closed(self) -> bool: ... # undocumented @property diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index 4f4470c97..e170b893c 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -33,6 +33,7 @@ class BaseContext: if sys.version_info >= (3, 8): @staticmethod def parent_process() -> BaseProcess | None: ... + @staticmethod def active_children() -> list[BaseProcess]: ... def cpu_count(self) -> int: ... @@ -113,6 +114,7 @@ class BaseContext: def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... @overload def get_context(self, method: str) -> BaseContext: ... + def get_start_method(self, allow_none: bool = ...) -> str: ... def set_start_method(self, method: str | None, force: bool = ...) -> None: ... @property @@ -140,20 +142,25 @@ if sys.platform != "win32": _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> Any: ... + class SpawnProcess(BaseProcess): _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> SpawnProcess: ... + class ForkServerProcess(BaseProcess): _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> Any: ... + class ForkContext(BaseContext): _name: str Process: type[ForkProcess] + class SpawnContext(BaseContext): _name: str Process: type[SpawnProcess] + class ForkServerContext(BaseContext): _name: str Process: type[ForkServerProcess] @@ -163,6 +170,7 @@ else: _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> Any: ... + class SpawnContext(BaseContext): _name: str Process: type[SpawnProcess] diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 42853dfd3..b9959b41a 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -113,6 +113,7 @@ class RemoteError(Exception): ... if sys.version_info >= (3, 8): class SharedMemoryServer(Server): ... + class SharedMemoryManager(BaseManager): def get_server(self) -> SharedMemoryServer: ... def SharedMemory(self, size: int) -> _SharedMemory: ... diff --git a/stdlib/multiprocessing/pool.pyi b/stdlib/multiprocessing/pool.pyi index 7c2fd8a06..55bdd940e 100644 --- a/stdlib/multiprocessing/pool.pyi +++ b/stdlib/multiprocessing/pool.pyi @@ -24,6 +24,7 @@ class ApplyResult(Generic[_T]): callback: Callable[[_T], None] | None, error_callback: Callable[[BaseException], None] | None, ) -> None: ... + def get(self, timeout: float | None = ...) -> _T: ... def wait(self, timeout: float | None = ...) -> None: ... def ready(self) -> bool: ... @@ -59,6 +60,7 @@ class IMapIterator(Iterator[_T]): def __init__(self, pool: Pool) -> None: ... else: def __init__(self, cache: dict[int, IMapIterator[Any]]) -> None: ... + def __iter__(self: Self) -> Self: ... def next(self, timeout: float | None = ...) -> _T: ... def __next__(self, timeout: float | None = ...) -> _T: ... diff --git a/stdlib/multiprocessing/process.pyi b/stdlib/multiprocessing/process.pyi index 4746c78b1..2e76ea551 100644 --- a/stdlib/multiprocessing/process.pyi +++ b/stdlib/multiprocessing/process.pyi @@ -22,6 +22,7 @@ class BaseProcess: if sys.version_info >= (3, 7): def kill(self) -> None: ... def close(self) -> None: ... + def join(self, timeout: float | None = ...) -> None: ... def is_alive(self) -> bool: ... @property diff --git a/stdlib/multiprocessing/queues.pyi b/stdlib/multiprocessing/queues.pyi index 1c9d76917..ed544470c 100644 --- a/stdlib/multiprocessing/queues.pyi +++ b/stdlib/multiprocessing/queues.pyi @@ -30,6 +30,7 @@ class SimpleQueue(Generic[_T]): def __init__(self, *, ctx: Any = ...) -> None: ... if sys.version_info >= (3, 9): def close(self) -> None: ... + def empty(self) -> bool: ... def get(self) -> _T: ... def put(self, item: _T) -> None: ... diff --git a/stdlib/multiprocessing/shared_memory.pyi b/stdlib/multiprocessing/shared_memory.pyi index 1b51da38b..8255af382 100644 --- a/stdlib/multiprocessing/shared_memory.pyi +++ b/stdlib/multiprocessing/shared_memory.pyi @@ -18,6 +18,7 @@ if sys.version_info >= (3, 8): def size(self) -> int: ... def close(self) -> None: ... def unlink(self) -> None: ... + class ShareableList(Generic[_SLT]): shm: SharedMemory def __init__(self, sequence: Iterable[_SLT] | None = ..., *, name: str | None = ...) -> None: ... diff --git a/stdlib/multiprocessing/synchronize.pyi b/stdlib/multiprocessing/synchronize.pyi index c32c9aafe..873bc8f40 100644 --- a/stdlib/multiprocessing/synchronize.pyi +++ b/stdlib/multiprocessing/synchronize.pyi @@ -20,6 +20,7 @@ class Condition(AbstractContextManager[bool]): def notify(self, n: int = ...) -> None: ... else: def notify(self) -> None: ... + def notify_all(self) -> None: ... def wait(self, timeout: float | None = ...) -> bool: ... def wait_for(self, predicate: Callable[[], bool], timeout: float | None = ...) -> bool: ... diff --git a/stdlib/nis.pyi b/stdlib/nis.pyi index b762ae462..10eef2336 100644 --- a/stdlib/nis.pyi +++ b/stdlib/nis.pyi @@ -5,4 +5,5 @@ if sys.platform != "win32": def get_default_domain() -> str: ... def maps(domain: str = ...) -> list[str]: ... def match(key: str, map: str, domain: str = ...) -> str: ... + class error(Exception): ... diff --git a/stdlib/nntplib.pyi b/stdlib/nntplib.pyi index f0a0fb42d..befc81870 100644 --- a/stdlib/nntplib.pyi +++ b/stdlib/nntplib.pyi @@ -77,6 +77,7 @@ class _NNTPBase: if sys.version_info < (3, 9): def xgtitle(self, group: str, *, file: _File = ...) -> tuple[str, _list[tuple[str, str]]]: ... def xpath(self, id: Any) -> tuple[str, str]: ... + def date(self) -> tuple[str, datetime.datetime]: ... def post(self, data: bytes | Iterable[bytes]) -> str: ... def ihave(self, message_id: Any, data: bytes | Iterable[bytes]) -> str: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 3341c50f6..6229839ba 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -240,6 +240,7 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): putenv: Callable[[AnyStr, AnyStr], None], unsetenv: Callable[[AnyStr, AnyStr], None], ) -> None: ... + def setdefault(self, key: AnyStr, value: AnyStr) -> AnyStr: ... # type: ignore[override] def copy(self) -> dict[AnyStr, AnyStr]: ... def __delitem__(self, key: AnyStr) -> None: ... @@ -471,6 +472,7 @@ if sys.platform != "win32": if sys.platform != "darwin": def getresuid() -> tuple[int, int, int]: ... def getresgid() -> tuple[int, int, int]: ... + def getuid() -> int: ... def setegid(__egid: int) -> None: ... def seteuid(__euid: int) -> None: ... @@ -482,6 +484,7 @@ if sys.platform != "win32": if sys.platform != "darwin": 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 setsid() -> None: ... @@ -618,6 +621,7 @@ if sys.platform != "win32": 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: bytes, __offset: int) -> int: ... if sys.platform != "darwin": @@ -902,7 +906,9 @@ else: def si_status(self) -> int: ... @property def si_code(self) -> int: ... + def waitid(idtype: int, ident: int, options: int) -> waitid_result: ... + def wait3(options: int) -> tuple[int, int, Any]: ... def wait4(pid: int, options: int) -> tuple[int, int, Any]: ... def WCOREDUMP(__status: int) -> bool: ... @@ -950,6 +956,7 @@ if sys.platform != "win32": def __new__(cls, sched_priority: int) -> sched_param: ... @property def sched_priority(self) -> int: ... + def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix def sched_yield() -> None: ... # some flavors of Unix @@ -991,6 +998,7 @@ if sys.version_info >= (3, 8): def close(self) -> None: ... def __enter__(self: Self) -> Self: ... def __exit__(self, *args: Any) -> None: ... + def add_dll_directory(path: str) -> _AddedDllDirectory: ... if sys.platform == "linux": MFD_CLOEXEC: int diff --git a/stdlib/pathlib.pyi b/stdlib/pathlib.pyi index 3313bae9c..f2599c720 100644 --- a/stdlib/pathlib.pyi +++ b/stdlib/pathlib.pyi @@ -41,11 +41,13 @@ class PurePath(PathLike[str]): def is_reserved(self) -> bool: ... if sys.version_info >= (3, 9): def is_relative_to(self, *other: StrPath) -> bool: ... + def match(self, path_pattern: str) -> bool: ... def relative_to(self: Self, *other: StrPath) -> Self: ... def with_name(self: Self, name: str) -> Self: ... if sys.version_info >= (3, 9): def with_stem(self: Self, stem: str) -> Self: ... + def with_suffix(self: Self, suffix: str) -> Self: ... def joinpath(self: Self, *other: StrPath) -> Self: ... @property @@ -72,6 +74,7 @@ class Path(PurePath): else: def stat(self) -> stat_result: ... def chmod(self, mode: int) -> None: ... + def exists(self) -> bool: ... def glob(self: Self, pattern: str) -> Generator[Self, None, None]: ... def group(self) -> str: ... @@ -79,6 +82,7 @@ class Path(PurePath): def is_file(self) -> bool: ... if sys.version_info >= (3, 7): def is_mount(self) -> bool: ... + def is_symlink(self) -> bool: ... def is_socket(self) -> bool: ... def is_fifo(self) -> bool: ... @@ -152,17 +156,20 @@ class Path(PurePath): else: def rename(self, target: str | PurePath) -> None: ... def replace(self, target: str | PurePath) -> None: ... + def resolve(self: Self, strict: bool = ...) -> Self: ... def rglob(self: Self, pattern: str) -> Generator[Self, None, None]: ... def rmdir(self) -> None: ... def symlink_to(self, target: str | Path, target_is_directory: bool = ...) -> None: ... if sys.version_info >= (3, 10): def hardlink_to(self, target: str | Path) -> None: ... + def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... if sys.version_info >= (3, 8): def unlink(self, missing_ok: bool = ...) -> None: ... else: def unlink(self) -> None: ... + @classmethod def home(cls: type[Self]) -> Self: ... def absolute(self: Self) -> Self: ... diff --git a/stdlib/pickle.pyi b/stdlib/pickle.pyi index d165e6e28..fffd1e1eb 100644 --- a/stdlib/pickle.pyi +++ b/stdlib/pickle.pyi @@ -82,6 +82,7 @@ class Pickler: def reducer_override(self, obj: Any) -> Any: ... else: def __init__(self, file: _WritableFileobj, protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ... + def dump(self, __obj: Any) -> None: ... def clear_memo(self) -> None: ... def persistent_id(self, obj: Any) -> Any: ... @@ -103,6 +104,7 @@ class Unpickler: def __init__( self, file: _ReadableFileobj, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ... ) -> None: ... + def load(self) -> Any: ... def find_class(self, __module_name: str, __global_name: str) -> Any: ... def persistent_load(self, pid: Any) -> Any: ... diff --git a/stdlib/pprint.pyi b/stdlib/pprint.pyi index 9e343feb4..1c88793ba 100644 --- a/stdlib/pprint.pyi +++ b/stdlib/pprint.pyi @@ -126,6 +126,7 @@ class PrettyPrinter: *, compact: bool = ..., ) -> None: ... + def pformat(self, object: object) -> str: ... def pprint(self, object: object) -> None: ... def isreadable(self, object: object) -> bool: ... diff --git a/stdlib/pstats.pyi b/stdlib/pstats.pyi index 132830846..7b44e34d7 100644 --- a/stdlib/pstats.pyi +++ b/stdlib/pstats.pyi @@ -8,6 +8,7 @@ _Selector = Union[str, float, int] if sys.version_info >= (3, 7): from enum import Enum + class SortKey(str, Enum): CALLS: str CUMULATIVE: str diff --git a/stdlib/pwd.pyi b/stdlib/pwd.pyi index 08a9facf6..84f6dc5cc 100644 --- a/stdlib/pwd.pyi +++ b/stdlib/pwd.pyi @@ -20,6 +20,7 @@ if sys.platform != "win32": def pw_dir(self) -> str: ... @property def pw_shell(self) -> str: ... + def getpwall() -> list[struct_passwd]: ... def getpwuid(__uid: int) -> struct_passwd: ... def getpwnam(__name: str) -> struct_passwd: ... diff --git a/stdlib/py_compile.pyi b/stdlib/py_compile.pyi index 2c967c221..d9dca05c7 100644 --- a/stdlib/py_compile.pyi +++ b/stdlib/py_compile.pyi @@ -10,6 +10,7 @@ class PyCompileError(Exception): if sys.version_info >= (3, 7): import enum + class PycInvalidationMode(enum.Enum): TIMESTAMP: int CHECKED_HASH: int diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 362374f9b..b96a9f7de 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -15,6 +15,7 @@ class Random(_random.Random): def seed(self, a: int | float | str | bytes | bytearray | None = ..., version: int = ...) -> None: ... # type: ignore[override] else: def seed(self, a: Any = ..., version: int = ...) -> None: ... + def getstate(self) -> tuple[Any, ...]: ... def setstate(self, state: tuple[Any, ...]) -> None: ... def getrandbits(self, __k: int) -> int: ... @@ -22,6 +23,7 @@ class Random(_random.Random): def randint(self, a: int, b: int) -> int: ... if sys.version_info >= (3, 9): def randbytes(self, n: int) -> bytes: ... + def choice(self, seq: SupportsLenAndGetItem[_T]) -> _T: ... def choices( self, @@ -38,6 +40,7 @@ class Random(_random.Random): ) -> list[_T]: ... else: def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ... + def random(self) -> float: ... def uniform(self, a: float, b: float) -> float: ... def triangular(self, low: float = ..., high: float = ..., mode: float | None = ...) -> float: ... diff --git a/stdlib/resource.pyi b/stdlib/resource.pyi index 19a6f470b..427f4995e 100644 --- a/stdlib/resource.pyi +++ b/stdlib/resource.pyi @@ -61,6 +61,7 @@ if sys.platform != "win32": def ru_nvcsw(self) -> int: ... @property def ru_nivcsw(self) -> int: ... + def getpagesize() -> int: ... def getrlimit(__resource: int) -> tuple[int, int]: ... def getrusage(__who: int) -> struct_rusage: ... diff --git a/stdlib/signal.pyi b/stdlib/signal.pyi index 777391662..0b3dcb756 100644 --- a/stdlib/signal.pyi +++ b/stdlib/signal.pyi @@ -105,10 +105,12 @@ else: SIGWINCH: Signals SIGXCPU: Signals SIGXFSZ: Signals + class ItimerError(IOError): ... ITIMER_PROF: int ITIMER_REAL: int ITIMER_VIRTUAL: int + class Sigmasks(IntEnum): SIG_BLOCK: int SIG_UNBLOCK: int @@ -147,6 +149,7 @@ else: def si_status(self) -> int: ... @property def si_band(self) -> int: ... + def sigtimedwait(sigset: Iterable[int], timeout: float) -> struct_siginfo | None: ... def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ... diff --git a/stdlib/socketserver.pyi b/stdlib/socketserver.pyi index b50d816f3..15f04f963 100644 --- a/stdlib/socketserver.pyi +++ b/stdlib/socketserver.pyi @@ -77,6 +77,7 @@ if sys.platform != "win32": RequestHandlerClass: Callable[..., BaseRequestHandler], bind_and_activate: bool = ..., ) -> None: ... + class UnixDatagramServer(BaseServer): def __init__( self, diff --git a/stdlib/spwd.pyi b/stdlib/spwd.pyi index 7a62d6252..82d9b8dbf 100644 --- a/stdlib/spwd.pyi +++ b/stdlib/spwd.pyi @@ -24,5 +24,6 @@ if sys.platform != "win32": def sp_expire(self) -> int: ... @property def sp_flag(self) -> int: ... + def getspall() -> list[struct_spwd]: ... def getspnam(__arg: str) -> struct_spwd: ... diff --git a/stdlib/sqlite3/dbapi2.pyi b/stdlib/sqlite3/dbapi2.pyi index 32b4a2e95..1c5960ad5 100644 --- a/stdlib/sqlite3/dbapi2.pyi +++ b/stdlib/sqlite3/dbapi2.pyi @@ -151,6 +151,7 @@ class Connection: def create_function(self, name: str, narg: int, func: Any, *, deterministic: bool = ...) -> None: ... else: def create_function(self, name: str, num_params: int, func: Any) -> None: ... + def cursor(self, cursorClass: type | None = ...) -> Cursor: ... def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ... # TODO: please check in executemany() if seq_of_parameters type is possible like this @@ -178,6 +179,7 @@ class Connection: name: str = ..., sleep: float = ..., ) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __enter__(self: Self) -> Self: ... def __exit__(self, t: type | None, exc: BaseException | None, tb: Any | None) -> None: ... diff --git a/stdlib/sre_parse.pyi b/stdlib/sre_parse.pyi index c4de55bcb..56d551180 100644 --- a/stdlib/sre_parse.pyi +++ b/stdlib/sre_parse.pyi @@ -54,6 +54,7 @@ class SubPattern: else: pattern: Pattern def __init__(self, pattern: Pattern, data: list[_CodeType] | None = ...) -> None: ... + def dump(self, level: int = ...) -> None: ... def __len__(self) -> int: ... def __delitem__(self, index: int | slice) -> None: ... @@ -77,6 +78,7 @@ class Tokenizer: def getuntil(self, terminator: str, name: str) -> str: ... else: def getuntil(self, terminator: str) -> str: ... + @property def pos(self) -> int: ... def tell(self) -> int: ... diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index cd5182de7..28f616ece 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -332,6 +332,7 @@ class SSLSocket(socket.socket): _context: SSLContext | None = ..., _session: Any | None = ..., ) -> None: ... + def connect(self, addr: socket._Address | bytes) -> None: ... def connect_ex(self, addr: socket._Address | bytes) -> int: ... def recv(self, buflen: int = ..., flags: int = ...) -> bytes: ... @@ -416,6 +417,7 @@ class SSLContext: def set_servername_callback(self, server_name_callback: _SrvnmeCbType | None) -> None: ... else: def set_servername_callback(self, __method: _SrvnmeCbType | None) -> None: ... + def load_dh_params(self, __path: str) -> None: ... def set_ecdh_curve(self, __name: str) -> None: ... def wrap_socket( @@ -447,6 +449,7 @@ class SSLObject: def __init__(self, *args: Any, **kwargs: Any) -> None: ... else: def __init__(self, sslobj: Any, owner: SSLSocket | SSLObject | None = ..., session: Any | None = ...) -> None: ... + def read(self, len: int = ..., buffer: bytearray | None = ...) -> bytes: ... def write(self, data: bytes) -> int: ... @overload diff --git a/stdlib/statistics.pyi b/stdlib/statistics.pyi index 8437a43ff..912995fdd 100644 --- a/stdlib/statistics.pyi +++ b/stdlib/statistics.pyi @@ -66,6 +66,7 @@ if sys.version_info >= (3, 8): def quantiles(self, n: int = ...) -> list[float]: ... if sys.version_info >= (3, 9): def zscore(self, x: float) -> float: ... + def __add__(self, x2: float | NormalDist) -> NormalDist: ... def __sub__(self, x2: float | NormalDist) -> NormalDist: ... def __mul__(self, x2: float) -> NormalDist: ... @@ -80,6 +81,7 @@ if sys.version_info >= (3, 8): if sys.version_info >= (3, 10): def correlation(__x: Sequence[_Number], __y: Sequence[_Number]) -> float: ... def covariance(__x: Sequence[_Number], __y: Sequence[_Number]) -> float: ... + class LinearRegression(NamedTuple): slope: float intercept: float diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index b13ed392f..8c03fa592 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -991,6 +991,7 @@ class Popen(Generic[AnyStr]): encoding: str | None = ..., errors: str | None = ..., ) -> Popen[Any]: ... + def poll(self) -> int | None: ... if sys.version_info >= (3, 7): def wait(self, timeout: float | None = ...) -> int: ... diff --git a/stdlib/symtable.pyi b/stdlib/symtable.pyi index bc25a4c46..1f89465fe 100644 --- a/stdlib/symtable.pyi +++ b/stdlib/symtable.pyi @@ -37,6 +37,7 @@ class Symbol: def is_nonlocal(self) -> bool: ... else: def __init__(self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = ...) -> None: ... + def get_name(self) -> str: ... def is_referenced(self) -> bool: ... def is_parameter(self) -> bool: ... diff --git a/stdlib/sys.pyi b/stdlib/sys.pyi index f8e7b4886..7fa626336 100644 --- a/stdlib/sys.pyi +++ b/stdlib/sys.pyi @@ -271,6 +271,7 @@ if sys.platform == "win32": def product_type(self) -> int: ... @property def platform_version(self) -> tuple[int, int, int]: ... + def getwindowsversion() -> _WinVersion: ... def intern(__string: str) -> str: ... diff --git a/stdlib/tarfile.pyi b/stdlib/tarfile.pyi index c98608d49..640cd5188 100644 --- a/stdlib/tarfile.pyi +++ b/stdlib/tarfile.pyi @@ -296,6 +296,7 @@ class TarFile: *, filter: Callable[[TarInfo], TarInfo | None] | None = ..., ) -> None: ... + def addfile(self, tarinfo: TarInfo, fileobj: IO[bytes] | None = ...) -> None: ... def gettarinfo(self, name: str | None = ..., arcname: str | None = ..., fileobj: IO[bytes] | None = ...) -> TarInfo: ... def close(self) -> None: ... diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index 9b5e2bb82..f4e608198 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -290,6 +290,7 @@ class SpooledTemporaryFile(IO[AnyStr]): prefix: str | None = ..., dir: str | None = ..., ) -> None: ... + def rollover(self) -> None: ... def __enter__(self: Self) -> Self: ... def __exit__( @@ -343,6 +344,7 @@ class TemporaryDirectory(Generic[AnyStr]): def __init__(self: TemporaryDirectory[str], suffix: None = ..., prefix: None = ..., dir: None = ...) -> None: ... @overload def __init__(self, suffix: AnyStr | None = ..., prefix: AnyStr | None = ..., dir: _DirT[AnyStr] | None = ...) -> None: ... + def cleanup(self) -> None: ... def __enter__(self) -> AnyStr: ... def __exit__( diff --git a/stdlib/termios.pyi b/stdlib/termios.pyi index 7142df157..6ef2f6818 100644 --- a/stdlib/termios.pyi +++ b/stdlib/termios.pyi @@ -243,4 +243,5 @@ if sys.platform != "win32": def tcdrain(__fd: FileDescriptorLike) -> None: ... def tcflush(__fd: FileDescriptorLike, __queue: int) -> None: ... def tcflow(__fd: FileDescriptorLike, __action: int) -> None: ... + class error(Exception): ... diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index 10853ff87..11aa06aa6 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -59,6 +59,7 @@ class Thread: if sys.version_info >= (3, 8): @property def native_id(self) -> int | None: ... # only available on some platforms + def is_alive(self) -> bool: ... if sys.version_info < (3, 9): def isAlive(self) -> bool: ... diff --git a/stdlib/time.pyi b/stdlib/time.pyi index c5ef075a4..815171f0c 100644 --- a/stdlib/time.pyi +++ b/stdlib/time.pyi @@ -99,6 +99,7 @@ if sys.version_info >= (3, 7): if sys.platform != "win32": def clock_gettime_ns(clock_id: int) -> int: ... def clock_settime_ns(clock_id: int, time: int) -> int: ... + def monotonic_ns() -> int: ... def perf_counter_ns() -> int: ... def process_time_ns() -> int: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index bac6fe4d6..058fe80ed 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -622,6 +622,7 @@ class Tk(Misc, Wm): if sys.platform != "win32": def createfilehandler(self, __file, __mask, __func): ... def deletefilehandler(self, __file): ... + def createtimerhandler(self, __milliseconds, __func): ... def dooneevent(self, __flags: int = ...): ... def eval(self, __script: str) -> str: ... @@ -638,6 +639,7 @@ class Tk(Misc, Wm): def record(self, __script): ... if sys.version_info < (3, 11): def split(self, __arg): ... + def splitlist(self, __arg): ... def unsetvar(self, *args, **kwargs): ... def wantobjects(self, *args, **kwargs): ... @@ -1412,6 +1414,7 @@ class Canvas(Widget, XView, YView): def move(self, *args): ... if sys.version_info >= (3, 8): def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = ..., y: Literal[""] | float = ...) -> None: ... + def postscript(self, cnf=..., **kw): ... # tkinter does: # lower = tag_lower diff --git a/stdlib/tkinter/ttk.pyi b/stdlib/tkinter/ttk.pyi index 7d5a3b1eb..7cef740ea 100644 --- a/stdlib/tkinter/ttk.pyi +++ b/stdlib/tkinter/ttk.pyi @@ -1069,6 +1069,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def selection(self) -> tuple[str, ...]: ... else: def selection(self, selop: Any | None = ..., items: Any | None = ...) -> tuple[str, ...]: ... + def selection_set(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_add(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_remove(self, items: str | list[str] | tuple[str, ...]) -> None: ... diff --git a/stdlib/trace.pyi b/stdlib/trace.pyi index ee8dffa67..d6b6eabd2 100644 --- a/stdlib/trace.pyi +++ b/stdlib/trace.pyi @@ -46,6 +46,7 @@ class Trace: def runfunc(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ... else: def runfunc(self, func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ... + def file_module_function_of(self, frame: types.FrameType) -> _fileModuleFunction: ... def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ... def globaltrace_countfuncs(self, frame: types.FrameType, why: str, arg: Any) -> None: ... diff --git a/stdlib/traceback.pyi b/stdlib/traceback.pyi index 09d817cf2..30d67d8dc 100644 --- a/stdlib/traceback.pyi +++ b/stdlib/traceback.pyi @@ -122,6 +122,7 @@ class TracebackException: def from_exception( cls, exc: BaseException, *, limit: int | None = ..., lookup_lines: bool = ..., capture_locals: bool = ... ) -> TracebackException: ... + def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... def format_exception_only(self) -> Generator[str, None, None]: ... diff --git a/stdlib/tracemalloc.pyi b/stdlib/tracemalloc.pyi index 4d7bbb799..0af707bb5 100644 --- a/stdlib/tracemalloc.pyi +++ b/stdlib/tracemalloc.pyi @@ -63,6 +63,7 @@ class Traceback(Sequence[Frame]): def format(self, limit: int | None = ..., most_recent_first: bool = ...) -> list[str]: ... else: def format(self, limit: int | None = ...) -> list[str]: ... + @overload def __getitem__(self, i: SupportsIndex) -> Frame: ... @overload diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 732789aff..e6fa40578 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -302,6 +302,7 @@ if sys.version_info >= (3, 7): __objclass__: type def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __get__(self, obj: Any, type: type = ...) -> Any: ... + @final class MethodWrapperType: __self__: object @@ -311,6 +312,7 @@ if sys.version_info >= (3, 7): def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... + @final class MethodDescriptorType: __name__: str @@ -318,6 +320,7 @@ if sys.version_info >= (3, 7): __objclass__: type def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __get__(self, obj: Any, type: type = ...) -> Any: ... + @final class ClassMethodDescriptorType: __name__: str diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index dcd9d920b..d51576428 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -73,9 +73,11 @@ if sys.version_info >= (3, 10): class ParamSpecArgs: __origin__: ParamSpec def __init__(self, origin: ParamSpec) -> None: ... + class ParamSpecKwargs: __origin__: ParamSpec def __init__(self, origin: ParamSpec) -> None: ... + class ParamSpec: __name__: str __bound__: Any | None @@ -91,6 +93,7 @@ if sys.version_info >= (3, 10): Concatenate: _SpecialForm TypeAlias: _SpecialForm TypeGuard: _SpecialForm + class NewType: def __init__(self, name: str, tp: type) -> None: ... def __call__(self, x: _T) -> _T: ... @@ -405,6 +408,7 @@ class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co, def __iter__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... if sys.version_info >= (3, 8): def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... + def __or__(self, o: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ... def __ror__(self, o: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ... def __sub__(self, o: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ... @@ -420,6 +424,7 @@ class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): def __iter__(self) -> Iterator[_KT_co]: ... if sys.version_info >= (3, 8): def __reversed__(self) -> Iterator[_KT_co]: ... + def __or__(self, o: Iterable[_T]) -> set[_KT_co | _T]: ... def __ror__(self, o: Iterable[_T]) -> set[_KT_co | _T]: ... def __sub__(self, o: Iterable[Any]) -> set[_KT_co]: ... @@ -711,6 +716,7 @@ class NamedTuple(tuple[Any, ...]): def _asdict(self) -> dict[str, Any]: ... else: def _asdict(self) -> collections.OrderedDict[str, Any]: ... + def _replace(self: Self, **kwargs: Any) -> Self: ... # Internal mypy fallback type for all typed dicts (does not exist at runtime) @@ -744,6 +750,7 @@ if sys.version_info >= (3, 7): def __init__(self, arg: str, is_argument: bool = ..., module: Any | None = ..., *, is_class: bool = ...) -> None: ... else: def __init__(self, arg: str, is_argument: bool = ...) -> None: ... + def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ... def __eq__(self, other: object) -> bool: ... def __hash__(self) -> int: ... diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index d1690e4e6..f0b395119 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -108,9 +108,11 @@ else: class ParamSpecArgs: __origin__: ParamSpec def __init__(self, origin: ParamSpec) -> None: ... + class ParamSpecKwargs: __origin__: ParamSpec def __init__(self, origin: ParamSpec) -> None: ... + class ParamSpec: __name__: str __bound__: type[Any] | None diff --git a/stdlib/unittest/_log.pyi b/stdlib/unittest/_log.pyi index 947a2158d..c27de6386 100644 --- a/stdlib/unittest/_log.pyi +++ b/stdlib/unittest/_log.pyi @@ -21,6 +21,7 @@ class _AssertLogsContext(Generic[_L]): no_logs: bool else: def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ... + def __enter__(self) -> _L: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index dabe63039..f1c04d71a 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -44,9 +44,11 @@ else: # this is generic over the logging watcher, but in lower versions # the watcher is hard-coded. _L = TypeVar("_L") + class _LoggingWatcher(NamedTuple): records: list[logging.LogRecord] output: list[str] + class _AssertLogsContext(_BaseTestCaseContext, Generic[_L]): LOGGING_FORMAT: ClassVar[str] test_case: TestCase @@ -170,6 +172,7 @@ class TestCase: def assertNoLogs( self, logger: str | logging.Logger | None = ..., level: int | str | None = ... ) -> _AssertLogsContext[None]: ... + @overload def assertAlmostEqual( self, first: float, second: float, places: int | None = ..., msg: Any = ..., delta: float | None = ... @@ -219,12 +222,14 @@ class TestCase: def addCleanup(self, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... else: def addCleanup(self, function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def doCleanups(self) -> None: ... if sys.version_info >= (3, 8): @classmethod def addClassCleanup(cls, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... @classmethod def doClassCleanups(cls) -> None: ... + def _formatMessage(self, msg: str | None, standardMsg: str) -> str: ... # undocumented def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented if sys.version_info < (3, 11): diff --git a/stdlib/unittest/main.pyi b/stdlib/unittest/main.pyi index 16c48ebdd..d3c0ca722 100644 --- a/stdlib/unittest/main.pyi +++ b/stdlib/unittest/main.pyi @@ -47,6 +47,7 @@ class TestProgram: def createTests(self, from_discovery: bool = ..., Loader: unittest.loader.TestLoader | None = ...) -> None: ... else: def createTests(self) -> None: ... + def runTests(self) -> None: ... # undocumented main = TestProgram diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index df3272138..4e26ac01f 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -93,6 +93,7 @@ class _Call(tuple[Any, ...]): def args(self): ... @property def kwargs(self): ... + def call_list(self) -> Any: ... call: _Call @@ -138,10 +139,12 @@ class NonCallableMock(Base, Any): else: def assert_called(_mock_self) -> None: ... def assert_called_once(_mock_self) -> None: ... + def reset_mock(self, visited: Any = ..., *, return_value: bool = ..., side_effect: bool = ...) -> None: ... if sys.version_info >= (3, 7): def _extract_mock_name(self) -> str: ... def _get_call_signature_from_name(self, name: str) -> Any: ... + def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = ...) -> None: ... def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... @@ -225,6 +228,7 @@ class _patch(Generic[_T]): new_callable: Any | None, kwargs: Mapping[str, Any], ) -> None: ... + def copy(self) -> _patch[_T]: ... @overload def __call__(self, func: _TT) -> _TT: ... @@ -232,10 +236,12 @@ class _patch(Generic[_T]): def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... if sys.version_info >= (3, 8): def decoration_helper(self, patched, args, keywargs): ... + def decorate_class(self, klass: _TT) -> _TT: ... def decorate_callable(self, func: Callable[..., _R]) -> Callable[..., _R]: ... if sys.version_info >= (3, 8): def decorate_async_callable(self, func: Callable[..., Awaitable[_R]]) -> Callable[..., Awaitable[_R]]: ... + def get_original(self) -> tuple[Any, bool]: ... target: Any temp_original: Any @@ -367,6 +373,7 @@ class _patcher: new_callable: Any | None = ..., **kwargs: Any, ) -> _patch[MagicMock]: ... + def multiple( self, target: Any, @@ -405,8 +412,10 @@ if sys.version_info >= (3, 8): await_count: int await_args: _Call | None await_args_list: _CallList + class AsyncMagicMixin(MagicMixin): def __init__(self, *args: Any, **kw: Any) -> None: ... + class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... # type: ignore # argument disparities between base classes class MagicProxy: @@ -415,6 +424,7 @@ class MagicProxy: def __init__(self, name, parent) -> None: ... if sys.version_info < (3, 8): def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self): ... def __get__(self, obj, _type: Any | None = ...): ... diff --git a/stdlib/urllib/response.pyi b/stdlib/urllib/response.pyi index 9065f3a94..970f134e4 100644 --- a/stdlib/urllib/response.pyi +++ b/stdlib/urllib/response.pyi @@ -49,6 +49,7 @@ class addinfourl(addinfo): if sys.version_info >= (3, 9): @property def status(self) -> int | None: ... + def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = ...) -> None: ... def geturl(self) -> str: ... def getcode(self) -> int | None: ... diff --git a/stdlib/uuid.pyi b/stdlib/uuid.pyi index 70e4a6133..4d46e89be 100644 --- a/stdlib/uuid.pyi +++ b/stdlib/uuid.pyi @@ -7,6 +7,7 @@ _FieldsType = tuple[int, int, int, int, int, int] if sys.version_info >= (3, 7): from enum import Enum + class SafeUUID(Enum): safe: int unsafe: int @@ -37,6 +38,7 @@ class UUID: int: _Int | None = ..., version: _Int | None = ..., ) -> None: ... + @property def bytes(self) -> _Bytes: ... @property diff --git a/stdlib/venv/__init__.pyi b/stdlib/venv/__init__.pyi index 7650e87d9..815490a20 100644 --- a/stdlib/venv/__init__.pyi +++ b/stdlib/venv/__init__.pyi @@ -35,6 +35,7 @@ class EnvBuilder: with_pip: bool = ..., prompt: str | None = ..., ) -> None: ... + def create(self, env_dir: StrOrBytesPath) -> None: ... def clear_directory(self, path: StrOrBytesPath) -> None: ... # undocumented def ensure_directories(self, env_dir: StrOrBytesPath) -> SimpleNamespace: ... diff --git a/stdlib/wsgiref/util.pyi b/stdlib/wsgiref/util.pyi index c769c77d3..0b6198ca5 100644 --- a/stdlib/wsgiref/util.pyi +++ b/stdlib/wsgiref/util.pyi @@ -10,6 +10,7 @@ class FileWrapper: def __init__(self, filelike: IO[bytes], blksize: int = ...) -> None: ... if sys.version_info < (3, 11): def __getitem__(self, key: Any) -> bytes: ... + def __iter__(self) -> FileWrapper: ... def __next__(self) -> bytes: ... diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index b6a96f1e3..7368b1f47 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -28,6 +28,7 @@ class Node(xml.dom.Node): else: def toxml(self, encoding: Any | None = ...): ... def toprettyxml(self, indent: str = ..., newl: str = ..., encoding: Any | None = ...): ... + def hasChildNodes(self) -> bool: ... def insertBefore(self, newChild, refChild): ... def appendChild(self, node): ... @@ -329,4 +330,5 @@ class Document(Node, DocumentLS): def writexml( self, writer, indent: str = ..., addindent: str = ..., newl: str = ..., encoding: Any | None = ... ) -> None: ... + def renameNode(self, n, namespaceURI: str, name): ... diff --git a/stdlib/xml/dom/pulldom.pyi b/stdlib/xml/dom/pulldom.pyi index c2b7aa077..ebde90a74 100644 --- a/stdlib/xml/dom/pulldom.pyi +++ b/stdlib/xml/dom/pulldom.pyi @@ -69,6 +69,7 @@ class DOMEventStream: pulldom: Any if sys.version_info < (3, 11): def __getitem__(self, pos): ... + def __next__(self): ... def __iter__(self): ... def getEvent(self) -> _Event: ... diff --git a/stdlib/xml/etree/ElementInclude.pyi b/stdlib/xml/etree/ElementInclude.pyi index b355bef12..5cd85cc21 100644 --- a/stdlib/xml/etree/ElementInclude.pyi +++ b/stdlib/xml/etree/ElementInclude.pyi @@ -20,6 +20,7 @@ if sys.version_info >= (3, 9): def include( elem: Element, loader: Callable[..., str | Element] | None = ..., base_url: str | None = ..., max_depth: int | None = ... ) -> None: ... + class LimitedRecursiveIncludeError(FatalIncludeError): ... else: diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index c0bef1e0b..fa1c01c83 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -119,6 +119,7 @@ class ElementTree: def iter(self, tag: str | None = ...) -> Generator[Element, None, None]: ... if sys.version_info < (3, 9): def getiterator(self, tag: str | None = ...) -> list[Element]: ... + def find(self, path: str, namespaces: dict[str, str] | None = ...) -> Element | None: ... @overload def findtext(self, path: str, default: None = ..., namespaces: dict[str, str] | None = ...) -> str | None: ... @@ -275,6 +276,7 @@ class TreeBuilder: insert_pis: bool else: def __init__(self, element_factory: _ElementFactory | None = ...) -> None: ... + def close(self) -> Element: ... def data(self, __data: str | bytes) -> None: ... def start(self, __tag: str | bytes, __attrs: dict[str | bytes, str | bytes]) -> Element: ... @@ -316,5 +318,6 @@ class XMLParser: else: def __init__(self, html: int = ..., target: Any = ..., encoding: str | None = ...) -> None: ... def doctype(self, __name: str, __pubid: str, __system: str) -> None: ... + def close(self) -> Any: ... def feed(self, __data: str | bytes) -> None: ... diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index 03a6ac69f..5aac530a9 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -228,6 +228,7 @@ class Transport: ) -> None: ... else: def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ... + def request(self, host: _HostType, handler: str, request_body: bytes, verbose: bool = ...) -> tuple[_Marshallable, ...]: ... def single_request( self, host: _HostType, handler: str, request_body: bytes, verbose: bool = ... @@ -254,6 +255,7 @@ class SafeTransport(Transport): ) -> None: ... else: def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, context: Any | None = ...) -> None: ... + def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ... class ServerProxy: @@ -292,6 +294,7 @@ class ServerProxy: *, context: Any | None = ..., ) -> None: ... + def __getattr__(self, name: str) -> _Method: ... @overload def __call__(self, attr: Literal["close"]) -> Callable[[], None]: ... diff --git a/stdlib/xmlrpc/server.pyi b/stdlib/xmlrpc/server.pyi index 650a65945..0a0742494 100644 --- a/stdlib/xmlrpc/server.pyi +++ b/stdlib/xmlrpc/server.pyi @@ -48,6 +48,7 @@ class SimpleXMLRPCDispatcher: # undocumented def register_function(self, function: _DispatchProtocol | None = ..., name: str | None = ...) -> Callable[..., Any]: ... else: def register_function(self, function: _DispatchProtocol, name: str | None = ...) -> Callable[..., Any]: ... + def register_introspection_functions(self) -> None: ... def register_multicall_functions(self) -> None: ... def _marshaled_dispatch( diff --git a/stdlib/xxlimited.pyi b/stdlib/xxlimited.pyi index 0dddbb876..56a4fac4c 100644 --- a/stdlib/xxlimited.pyi +++ b/stdlib/xxlimited.pyi @@ -15,4 +15,5 @@ if sys.version_info >= (3, 10): else: class error: ... class Null: ... + def roj(__b: Any) -> None: ... diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index a0a968ac9..a31a06c16 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -96,6 +96,7 @@ class ZipExtFile(io.BufferedIOBase): decrypter: Callable[[Sequence[int]], bytes] | None = ..., close_fileobj: Literal[False] = ..., ) -> None: ... + def read(self, n: int | None = ...) -> bytes: ... def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override] def peek(self, n: int = ...) -> bytes: ... @@ -142,6 +143,7 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], mode: _ZipFileMode = ..., compression: int = ..., allowZip64: bool = ... ) -> None: ... + def __enter__(self: Self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None @@ -214,6 +216,7 @@ class ZipInfo: else: @classmethod def from_file(cls, filename: StrPath, arcname: StrPath | None = ...) -> ZipInfo: ... + def is_dir(self) -> bool: ... def FileHeader(self, zip64: bool | None = ...) -> bytes: ... @@ -229,12 +232,14 @@ if sys.version_info >= (3, 8): if sys.version_info >= (3, 10): @property def filename(self) -> PathLike[str]: ... # undocumented + def __init__(self, root: ZipFile | StrPath | IO[bytes], at: str = ...) -> None: ... if sys.version_info >= (3, 9): def open(self, mode: _ReadWriteBinaryMode = ..., *args: Any, pwd: bytes | None = ..., **kwargs: Any) -> IO[bytes]: ... else: @property def open(self) -> _PathOpenProtocol: ... + def iterdir(self) -> Iterator[Path]: ... def is_dir(self) -> bool: ... def is_file(self) -> bool: ... @@ -252,6 +257,7 @@ if sys.version_info >= (3, 8): def joinpath(self, *other: StrPath) -> Path: ... else: def joinpath(self, add: StrPath) -> Path: ... # undocumented + def __truediv__(self, add: StrPath) -> Path: ... def is_zipfile(filename: StrPath | IO[bytes]) -> bool: ... diff --git a/stdlib/zipimport.pyi b/stdlib/zipimport.pyi index 3435092a4..982aa05ee 100644 --- a/stdlib/zipimport.pyi +++ b/stdlib/zipimport.pyi @@ -20,6 +20,7 @@ class zipimporter: def get_filename(self, fullname: str) -> str: ... if sys.version_info >= (3, 7): def get_resource_reader(self, fullname: str) -> ResourceReader | None: ... # undocumented + def get_source(self, fullname: str) -> str | None: ... def is_package(self, fullname: str) -> bool: ... def load_module(self, fullname: str) -> ModuleType: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi index 217ab044b..0645aa783 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi @@ -130,6 +130,7 @@ class AsyncAdapt_asyncpg_dbapi: paramstyle: str def __init__(self, asyncpg) -> None: ... def connect(self, *arg, **kw): ... + class Error(Exception): ... class Warning(Exception): ... class InterfaceError(Error): ... @@ -141,8 +142,10 @@ class AsyncAdapt_asyncpg_dbapi: class DataError(DatabaseError): ... class NotSupportedError(DatabaseError): ... class InternalServerError(InternalError): ... + class InvalidCachedStatementError(NotSupportedError): def __init__(self, message) -> None: ... + def Binary(self, value): ... STRING: Any TIMESTAMP: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index b3ba752bb..a2b167315 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -104,10 +104,12 @@ class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore # base c def adapt_emulated_to_native(cls, impl, **kw): ... def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + class EnumGenerator(DDLBase): checkfirst: Any def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... def visit_enum(self, enum) -> None: ... + class EnumDropper(DDLBase): checkfirst: Any def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi index f0cb163b9..df92db455 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi @@ -9,6 +9,7 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): hashable: bool text_type: Any def __init__(self, text_type: Any | None = ...) -> None: ... + class Comparator(sqltypes.Indexable.Comparator, sqltypes.Concatenable.Comparator): def has_key(self, other): ... def has_all(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi index d298402c5..fe4c63d39 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi @@ -9,6 +9,7 @@ class JSONPathType(sqltypes.JSON.JSONPathType): class JSON(sqltypes.JSON): astext_type: Any def __init__(self, none_as_null: bool = ..., astext_type: Any | None = ...) -> None: ... + class Comparator(sqltypes.JSON.Comparator): @property def astext(self): ... @@ -16,6 +17,7 @@ class JSON(sqltypes.JSON): class JSONB(JSON): __visit_name__: str + class Comparator(JSON.Comparator): def has_key(self, other): ... def has_all(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index 2ef9be686..824499d31 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -173,6 +173,7 @@ class Engine(Connectable, Identified): @property def driver(self): ... def dispose(self) -> None: ... + class _trans_ctx: conn: Connection transaction: Transaction @@ -182,6 +183,7 @@ class Engine(Connectable, Identified): def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... + def begin(self, close_with_result: bool = ...) -> _trans_ctx: ... # TODO: # def transaction(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T | None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi index 8b5db6170..f849acad0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi @@ -27,10 +27,12 @@ class CompositeProperty(DescriptorProperty): @property def columns(self): ... def get_history(self, state, dict_, passive=...): ... + class CompositeBundle(orm_util.Bundle): property: Any def __init__(self, property_, expr) -> None: ... def create_row_processor(self, query, procs, labels): ... + class Comparator(PropComparator): __hash__: Any @memoized_property diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/events.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/events.pyi index 1a7c3cad7..36a6414fc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/events.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/events.pyi @@ -26,7 +26,9 @@ class InstanceEvents(event.Events): class _EventsHold(event.RefCollection): class_: Any def __init__(self, class_) -> None: ... + class HoldEvents: ... + def remove(self, event_key) -> None: ... @classmethod def populate(cls, class_, subject) -> None: ... @@ -34,6 +36,7 @@ class _EventsHold(event.RefCollection): class _InstanceEventsHold(_EventsHold): all_holds: Any def resolve(self, class_): ... + class HoldInstanceEvents(_EventsHold.HoldEvents, InstanceEvents): ... dispatch: Any @@ -53,6 +56,7 @@ class MapperEvents(event.Events): class _MapperEventsHold(_EventsHold): all_holds: Any def resolve(self, class_): ... + class HoldMapperEvents(_EventsHold.HoldEvents, MapperEvents): ... dispatch: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi index 6b9babbfb..8d5d721e7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi @@ -9,6 +9,7 @@ def delete_obj(base_mapper, states, uowtransaction) -> None: ... class BulkUDCompileState(CompileState): class default_update_options(Options): ... + @classmethod def orm_pre_session_exec(cls, session, statement, params, execution_options, bind_arguments, is_reentrant_invoke): ... @classmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/properties.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/properties.pyi index 963321511..28d8980df 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/properties.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/properties.pyi @@ -37,6 +37,7 @@ class ColumnProperty(StrategizedProperty): def merge( self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map ) -> None: ... + class Comparator(util.MemoizedSlots, PropComparator): expressions: Any def _memoized_method___clause_element__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi index 69b52d7cb..c51860ba5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi @@ -83,6 +83,7 @@ class RelationshipProperty(StrategizedProperty): _legacy_inactive_history_style: bool = ..., ) -> None: ... def instrument_class(self, mapper) -> None: ... + class Comparator(PropComparator): prop: Any def __init__( @@ -105,6 +106,7 @@ class RelationshipProperty(StrategizedProperty): def __ne__(self, other): ... @memoized_property def property(self): ... + def merge( self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi index cb72a2b51..463e13ee3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi @@ -90,6 +90,7 @@ class SubqueryLoader(PostLoader): join_depth: Any def __init__(self, parent, strategy_key) -> None: ... def init_class_attribute(self, mapper) -> None: ... + class _SubqCollections: session: Any execution_options: Any @@ -99,6 +100,7 @@ class SubqueryLoader(PostLoader): def __init__(self, context, subq) -> None: ... def get(self, key, default): ... def loader(self, state, dict_, row) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators): ... class JoinedLoader(AbstractRelationshipLoader): @@ -122,6 +124,7 @@ class JoinedLoader(AbstractRelationshipLoader): class SelectInLoader(PostLoader, util.MemoizedSlots): logger: Any + class query_info(NamedTuple): load_only_child: Any load_with_join: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index 6e47dd97d..5075c49b9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -162,6 +162,7 @@ class Enum(Emulated, String, SchemaType): # type: ignore # argument disparities def sort_key_function(self): ... @property def native(self): ... + class Comparator(Concatenable.Comparator): ... comparator_factory: Any def as_generic(self, allow_nulltype: bool = ...): ... @@ -221,15 +222,18 @@ class JSON(Indexable, TypeEngine): NULL: Any none_as_null: Any def __init__(self, none_as_null: bool = ...) -> None: ... + class JSONElementType(TypeEngine): def string_bind_processor(self, dialect): ... def string_literal_processor(self, dialect): ... def bind_processor(self, dialect): ... def literal_processor(self, dialect): ... + class JSONIndexType(JSONElementType): ... class JSONIntIndexType(JSONIndexType): ... class JSONStrIndexType(JSONIndexType): ... class JSONPathType(JSONElementType): ... + class Comparator(Indexable.Comparator, Concatenable.Comparator): def as_boolean(self): ... def as_string(self): ... @@ -250,6 +254,7 @@ class JSON(Indexable, TypeEngine): class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): __visit_name__: str zero_indexes: bool + class Comparator(Indexable.Comparator, Concatenable.Comparator): def contains(self, *arg, **kw) -> None: ... def any(self, other, operator: Any | None = ...): ... @@ -340,6 +345,7 @@ class BOOLEAN(Boolean): class NullType(TypeEngine): __visit_name__: str def literal_processor(self, dialect): ... + class Comparator(TypeEngine.Comparator): ... comparator_factory: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index 96ad244e5..64142873e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -72,9 +72,11 @@ class TypeDecorator(ExternalType, SchemaEventTarget, TypeEngine): impl: Any def __init__(self, *args, **kwargs) -> None: ... coerce_to_is_types: Any + class Comparator(TypeEngine.Comparator): def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... + @property def comparator_factory(self): ... def type_engine(self, dialect): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi index 965d10654..78dd79992 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi @@ -89,11 +89,13 @@ class ColumnAdapter(ClauseAdapter): anonymize_labels: bool = ..., adapt_from_selectables: Any | None = ..., ) -> None: ... + class _IncludeExcludeMapping: parent: Any columns: Any def __init__(self, parent, columns) -> None: ... def __getitem__(self, key): ... + def wrap(self, adapter): ... def traverse(self, obj): ... adapt_clause: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 073d5a6b5..8a01199f9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -83,6 +83,7 @@ class HasMemoized: def __get__(self: Self, obj: None, cls: object) -> Self: ... @overload def __get__(self, obj: object, cls: object) -> _R: ... + @classmethod def memoized_instancemethod(cls, fn): ... diff --git a/stubs/braintree/braintree/credit_card.pyi b/stubs/braintree/braintree/credit_card.pyi index f6a373892..e68500363 100644 --- a/stubs/braintree/braintree/credit_card.pyi +++ b/stubs/braintree/braintree/credit_card.pyi @@ -25,9 +25,11 @@ class CreditCard(Resource): Switch: str Visa: str Unknown: str + class CustomerLocation: International: str US: str + class CardTypeIndicator: Yes: str No: str diff --git a/stubs/braintree/braintree/dispute.pyi b/stubs/braintree/braintree/dispute.pyi index 64a87eb04..edda8a919 100644 --- a/stubs/braintree/braintree/dispute.pyi +++ b/stubs/braintree/braintree/dispute.pyi @@ -17,6 +17,7 @@ class Dispute(AttributeGetter): Open: str Won: str Lost: str + class Reason: CancelledRecurringTransaction: str CreditNotProcessed: str @@ -29,10 +30,12 @@ class Dispute(AttributeGetter): ProductUnsatisfactory: str Retrieval: str TransactionAmountDiffers: str + class Kind: Chargeback: str PreArbitration: str Retrieval: str + class ChargebackProtectionLevel: Effortless: str Standard: str diff --git a/stubs/braintree/braintree/error_codes.pyi b/stubs/braintree/braintree/error_codes.pyi index 147f54dc4..994521144 100644 --- a/stubs/braintree/braintree/error_codes.pyi +++ b/stubs/braintree/braintree/error_codes.pyi @@ -29,6 +29,7 @@ class ErrorCodes: StreetAddressIsRequired: str StreetAddressIsTooLong: str TooManyAddressesPerCustomer: str + class ApplePay: ApplePayCardsAreNotAccepted: str CustomerIdIsRequiredForVaulting: str @@ -52,6 +53,7 @@ class ErrorCodes: InvalidToken: str PrivateKeyMismatch: str KeyMismatchStoringCertificate: str + class AuthorizationFingerprint: MissingFingerprint: str InvalidFormat: str @@ -60,6 +62,7 @@ class ErrorCodes: InvalidPublicKey: str InvalidSignature: str OptionsNotAllowedWithoutCustomer: str + class ClientToken: MakeDefaultRequiresCustomerId: str VerifyCardRequiresCustomerId: str @@ -68,6 +71,7 @@ class ErrorCodes: ProxyMerchantDoesNotExist: str UnsupportedVersion: str MerchantAccountDoesNotExist: str + class CreditCard: BillingAddressConflict: str BillingAddressFormatIsInvalid: str @@ -113,6 +117,7 @@ class ErrorCodes: VerificationNotSupportedOnThisMerchantAccount: str VerificationAccountTypeIsInvald: str VerificationAccountTypeNotSupported: str + class Options: UpdateExistingTokenIsInvalid: str UpdateExistingTokenNotAllowed: str @@ -124,6 +129,7 @@ class ErrorCodes: VerificationMerchantAccountIsForbidden: str VerificationMerchantAccountIsSuspended: str VerificationMerchantAccountCannotBeSubMerchantAccount: str + class Customer: CompanyIsTooLong: str CustomFieldIsInvalid: str @@ -145,6 +151,7 @@ class ErrorCodes: WebsiteIsInvalid: str WebsiteFormatIsInvalid: str WebsiteIsTooLong: str + class Descriptor: DynamicDescriptorsDisabled: str InternationalNameFormatIsInvalid: str @@ -152,6 +159,7 @@ class ErrorCodes: NameFormatIsInvalid: str PhoneFormatIsInvalid: str UrlFormatIsInvalid: str + class Dispute: CanOnlyAddEvidenceToOpenDispute: str CanOnlyRemoveEvidenceFromOpenDispute: str @@ -175,6 +183,7 @@ class ErrorCodes: RecurringTransactionEvidenceMissingDate: str RecurringTransactionEvidenceMissingARN: str ValidEvidenceRequiredToFinalize: str + class DocumentUpload: KindIsInvalid: str FileIsTooLarge: str @@ -182,6 +191,7 @@ class ErrorCodes: FileIsMalformedOrEncrypted: str FileIsTooLong: str FileIsEmpty: str + class Merchant: CountryCannotBeBlank: str CountryCodeAlpha2IsInvalid: str @@ -203,6 +213,7 @@ class ErrorCodes: CurrencyIsInvalid: str NoMerchantAccounts: str MerchantAccountExistsForId: str + class MerchantAccount: IdFormatIsInvalid: str IdIsInUse: str @@ -221,6 +232,7 @@ class ErrorCodes: DeclinedFailedKYC: str DeclinedSsnInvalid: str DeclinedSsnMatchesDeceased: str + class ApplicantDetails: AccountNumberIsRequired: str CompanyNameIsInvalid: str @@ -247,6 +259,7 @@ class ErrorCodes: EmailAddressIsRequired: str AccountNumberIsInvalid: str TaxIdMustBeBlank: str + class Address: LocalityIsRequired: str PostalCodeIsInvalid: str @@ -255,6 +268,7 @@ class ErrorCodes: StreetAddressIsInvalid: str StreetAddressIsRequired: str RegionIsInvalid: str + class Individual: FirstNameIsRequired: str LastNameIsRequired: str @@ -266,6 +280,7 @@ class ErrorCodes: PhoneIsInvalid: str DateOfBirthIsInvalid: str EmailAddressIsRequired: str + class Address: StreetAddressIsRequired: str LocalityIsRequired: str @@ -274,6 +289,7 @@ class ErrorCodes: StreetAddressIsInvalid: str PostalCodeIsInvalid: str RegionIsInvalid: str + class Business: DbaNameIsInvalid: str LegalNameIsInvalid: str @@ -281,10 +297,12 @@ class ErrorCodes: TaxIdIsInvalid: str TaxIdIsRequiredWithLegalName: str TaxIdMustBeBlank: str + class Address: StreetAddressIsInvalid: str PostalCodeIsInvalid: str RegionIsInvalid: str + class Funding: RoutingNumberIsRequired: str AccountNumberIsRequired: str @@ -296,12 +314,14 @@ class ErrorCodes: EmailAddressIsRequired: str MobilePhoneIsInvalid: str MobilePhoneIsRequired: str + class OAuth: InvalidGrant: str InvalidCredentials: str InvalidScope: str InvalidRequest: str UnsupportedGrantType: str + class Verification: ThreeDSecureAuthenticationIdIsInvalid: str ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication: str @@ -313,6 +333,7 @@ class ErrorCodes: MerchantAccountDoesNotSupport3DSecure: str MerchantAcountDoesNotMatch3DSecureMerchantAccount: str AmountDoesNotMatch3DSecureAmount: str + class ThreeDSecurePassThru: EciFlagIsRequired: str EciFlagIsInvalid: str @@ -322,6 +343,7 @@ class ErrorCodes: AuthenticationResponseIsInvalid: str DirectoryResponseIsInvalid: str CavvAlgorithmIsInvalid: str + class Options: AmountCannotBeNegative: str AmountFormatIsInvalid: str @@ -333,6 +355,7 @@ class ErrorCodes: MerchantAccountCannotBeSubMerchantAccount: str AccountTypeIsInvalid: str AccountTypeNotSupported: str + class PaymentMethod: CannotForwardPaymentMethodType: str PaymentMethodParamsAreRequired: str @@ -348,8 +371,10 @@ class ErrorCodes: CannotHaveFundingSourceWithoutAccessToken: str InvalidFundingSourceSelection: str CannotUpdatePayPalAccountUsingPaymentMethodNonce: str + class Options: UsBankAccountVerificationMethodIsInvalid: str + class PayPalAccount: CannotHaveBothAccessTokenAndConsentCode: str CannotVaultOneTimeUsePayPalAccount: str @@ -362,10 +387,12 @@ class ErrorCodes: PaymentMethodNonceLocked: str PaymentMethodNonceUnknown: str TokenIsInUse: str + class SettlementBatchSummary: CustomFieldIsInvalid: str SettlementDateIsInvalid: str SettlementDateIsRequired: str + class SEPAMandate: TypeIsRequired: str IBANInvalidCharacter: str @@ -377,10 +404,12 @@ class ErrorCodes: BillingAddressConflict: str BillingAddressIdIsInvalid: str TypeIsInvalid: str + class EuropeBankAccount: BICIsRequired: str IBANIsRequired: str AccountHolderNameIsRequired: str + class Subscription: BillingDayOfMonthCannotBeUpdated: str BillingDayOfMonthIsInvalid: str @@ -422,6 +451,7 @@ class ErrorCodes: TrialDurationFormatIsInvalid: str TrialDurationIsRequired: str TrialDurationUnitIsInvalid: str + class Modification: AmountCannotBeBlank: str AmountIsInvalid: str @@ -444,6 +474,7 @@ class ErrorCodes: QuantityIsInvalid: str QuantityMustBeGreaterThanZero: str IdToRemoveIsInvalid: str + class Transaction: AdjustmentAmountMustBeGreaterThanZero: str AmountCannotBeNegative: str @@ -586,24 +617,30 @@ class ErrorCodes: UnsupportedVoiceAuthorization: str UsBankAccountNonceMustBePlaidVerified: str UsBankAccountNotVerified: str + class ExternalVault: StatusIsInvalid: str StatusWithPreviousNetworkTransactionIdIsInvalid: str CardTypeIsInvalid: str PreviousNetworkTransactionIdIsInvalid: str + class Options: SubmitForSettlementIsRequiredForCloning: str SubmitForSettlementIsRequiredForPayPalUnilateral: str UseBillingForShippingDisabled: str VaultIsDisabled: str + class PayPal: CustomFieldTooLong: str + class CreditCard: AccountTypeIsInvalid: str AccountTypeNotSupported: str AccountTypeDebitDoesNotSupportAuths: str + class Industry: IndustryTypeIsInvalid: str + class Lodging: EmptyData: str FolioNumberIsInvalid: str @@ -621,6 +658,7 @@ class ErrorCodes: AdvancedDepositIndicatorIsInvalid: str FireSafetyIndicatorIsInvalid: str PropertyPhoneIsInvalid: str + class TravelCruise: EmptyData: str UnknownDataField: str @@ -628,6 +666,7 @@ class ErrorCodes: DepartureDateIsInvalid: str LodgingCheckInDateIsInvalid: str LodgingCheckOutDateIsInvalid: str + class TravelFlight: EmptyData: str UnknownDataField: str @@ -648,6 +687,7 @@ class ErrorCodes: TicketNumberIsTooLong: str LegsExpected: str TooManyLegs: str + class Leg: class TravelFlight: ArrivalAirportCodeIsTooLong: str @@ -670,6 +710,7 @@ class ErrorCodes: TaxAmountFormatIsInvalid: str TaxAmountIsTooLarge: str TicketNumberIsTooLong: str + class AdditionalCharge: KindIsInvalid: str KindMustBeUnique: str @@ -677,6 +718,7 @@ class ErrorCodes: AmountFormatIsInvalid: str AmountIsTooLarge: str AmountIsRequired: str + class LineItem: CommodityCodeIsTooLong: str DescriptionIsTooLong: str @@ -706,6 +748,7 @@ class ErrorCodes: TaxAmountFormatIsInvalid: str TaxAmountIsTooLarge: str TaxAmountCannotBeNegative: str + class UsBankAccountVerification: NotConfirmable: str MustBeMicroTransfersVerification: str @@ -713,6 +756,7 @@ class ErrorCodes: TooManyConfirmationAttempts: str UnableToConfirmDepositAmounts: str InvalidDepositAmounts: str + class RiskData: CustomerBrowserIsTooLong: str CustomerDeviceIdIsTooLong: str diff --git a/stubs/braintree/braintree/merchant_account/merchant_account.pyi b/stubs/braintree/braintree/merchant_account/merchant_account.pyi index 4bdb762ef..44729c209 100644 --- a/stubs/braintree/braintree/merchant_account/merchant_account.pyi +++ b/stubs/braintree/braintree/merchant_account/merchant_account.pyi @@ -13,6 +13,7 @@ class MerchantAccount(Resource): Active: str Pending: str Suspended: str + class FundingDestination: Bank: str Email: str diff --git a/stubs/braintree/braintree/search.pyi b/stubs/braintree/braintree/search.pyi index a9449ff61..14257a8d1 100644 --- a/stubs/braintree/braintree/search.pyi +++ b/stubs/braintree/braintree/search.pyi @@ -6,9 +6,11 @@ class Search: def __init__(self, name) -> None: ... def __eq__(self, value): ... def is_equal(self, value): ... + class EqualityNodeBuilder(IsNodeBuilder): def __ne__(self, value): ... def is_not_equal(self, value): ... + class KeyValueNodeBuilder: name: Any def __init__(self, name) -> None: ... @@ -16,28 +18,35 @@ class Search: def is_equal(self, value): ... def __ne__(self, value): ... def is_not_equal(self, value): ... + class PartialMatchNodeBuilder(EqualityNodeBuilder): def starts_with(self, value): ... def ends_with(self, value): ... + class EndsWithNodeBuilder: name: Any def __init__(self, name) -> None: ... def ends_with(self, value): ... + class TextNodeBuilder(PartialMatchNodeBuilder): def contains(self, value): ... + class Node: name: Any dict: Any def __init__(self, name, dict) -> None: ... def to_param(self): ... + class MultipleValueNodeBuilder: name: Any whitelist: Any def __init__(self, name, whitelist=...) -> None: ... def in_list(self, *values): ... def __eq__(self, value): ... + class MultipleValueOrTextNodeBuilder(TextNodeBuilder, MultipleValueNodeBuilder): def __init__(self, name, whitelist=...) -> None: ... + class RangeNodeBuilder: name: Any def __init__(self, name) -> None: ... diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index 33aa2bc44..7819c0909 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -17,10 +17,12 @@ class Subscription(Resource): class TrialDurationUnit: Day: str Month: str + class Source: Api: str ControlPanel: str Recurring: str + class Status: Active: str Canceled: str diff --git a/stubs/braintree/braintree/transaction.pyi b/stubs/braintree/braintree/transaction.pyi index 59cee2fe0..c89b67033 100644 --- a/stubs/braintree/braintree/transaction.pyi +++ b/stubs/braintree/braintree/transaction.pyi @@ -40,6 +40,7 @@ class Transaction(Resource): class CreatedUsing: FullInformation: str Token: str + class GatewayRejectionReason: ApplicationIncomplete: str Avs: str @@ -50,16 +51,19 @@ class Transaction(Resource): RiskThreshold: str ThreeDSecure: str TokenIssuance: str + class Source: Api: str ControlPanel: str Recurring: str + class EscrowStatus: HoldPending: str Held: str ReleasePending: str Released: str Refunded: str + class Status: AuthorizationExpired: str Authorized: str @@ -75,13 +79,16 @@ class Transaction(Resource): Settling: str SubmittedForSettlement: str Voided: str + class Type: Credit: str Sale: str + class IndustryType: Lodging: str TravelAndCruise: str TravelAndFlight: str + class AdditionalCharge: Restaurant: str GiftShop: str diff --git a/stubs/braintree/braintree/us_bank_account_verification.pyi b/stubs/braintree/braintree/us_bank_account_verification.pyi index cf4bd42cb..517d5ec40 100644 --- a/stubs/braintree/braintree/us_bank_account_verification.pyi +++ b/stubs/braintree/braintree/us_bank_account_verification.pyi @@ -11,6 +11,7 @@ class UsBankAccountVerification(AttributeGetter): Unrecognized: str Verified: str Pending: str + class VerificationMethod: NetworkCheck: str IndependentCheck: str diff --git a/stubs/colorama/colorama/win32.pyi b/stubs/colorama/colorama/win32.pyi index 554603de8..0a6f4ca23 100644 --- a/stubs/colorama/colorama/win32.pyi +++ b/stubs/colorama/colorama/win32.pyi @@ -10,6 +10,7 @@ if sys.platform == "win32": windll: LibraryLoader[WinDLL] COORD = wintypes._COORD + class CONSOLE_SCREEN_BUFFER_INFO(Structure): dwSize: COORD dwCursorPosition: COORD diff --git a/stubs/colorama/colorama/winterm.pyi b/stubs/colorama/colorama/winterm.pyi index a827463c0..af1dd3db1 100644 --- a/stubs/colorama/colorama/winterm.pyi +++ b/stubs/colorama/colorama/winterm.pyi @@ -3,6 +3,7 @@ import sys if sys.platform == "win32": from . import win32 + class WinColor: BLACK: int = ... BLUE: int = ... @@ -12,10 +13,12 @@ if sys.platform == "win32": MAGENTA: int = ... YELLOW: int = ... GREY: int = ... + class WinStyle: NORMAL: int = ... BRIGHT: int = ... BRIGHT_BACKGROUND: int = ... + class WinTerm: def __init__(self) -> None: ... def get_attrs(self) -> int: ... diff --git a/stubs/ldap3/ldap3/strategy/reusable.pyi b/stubs/ldap3/ldap3/strategy/reusable.pyi index cc5bfad41..2203fdf72 100644 --- a/stubs/ldap3/ldap3/strategy/reusable.pyi +++ b/stubs/ldap3/ldap3/strategy/reusable.pyi @@ -14,6 +14,7 @@ class ReusableStrategy(BaseStrategy): def receiving(self) -> None: ... def get_stream(self) -> None: ... def set_stream(self, value) -> None: ... + class ConnectionPool: def __new__(cls, connection): ... name: Any @@ -37,12 +38,14 @@ class ReusableStrategy(BaseStrategy): def start_pool(self): ... def create_pool(self) -> None: ... def terminate_pool(self) -> None: ... + class PooledConnectionThread(Thread): daemon: bool worker: Any master_connection: Any def __init__(self, worker, master_connection) -> None: ... def run(self) -> None: ... + class PooledConnectionWorker: master_connection: Any request_queue: Any diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index 225415a59..33b47244d 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -24,6 +24,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): def viewitems(self) -> ItemsView[str, object]: ... def viewkeys(self) -> KeysView[str]: ... def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... def TypedDict(typename: str, fields: dict[str, type[Any]], total: bool = ...) -> type[dict[str, Any]]: ... diff --git a/stubs/paramiko/paramiko/_winapi.pyi b/stubs/paramiko/paramiko/_winapi.pyi index 8ec689b10..7bf555876 100644 --- a/stubs/paramiko/paramiko/_winapi.pyi +++ b/stubs/paramiko/paramiko/_winapi.pyi @@ -7,12 +7,14 @@ from typing import Any if sys.platform == "win32": def format_system_message(errno: int) -> str | None: ... + class WindowsError(builtins.WindowsError): def __init__(self, value: int | None = ...) -> None: ... @property def message(self) -> str: ... @property def code(self) -> int: ... + def handle_nonzero_success(result: int) -> None: ... GMEM_MOVEABLE: int GlobalAlloc: Any @@ -23,6 +25,7 @@ if sys.platform == "win32": MapViewOfFile: Any UnmapViewOfFile: Any RtlMoveMemory: Any + class MemoryMap: name: str length: int @@ -61,15 +64,20 @@ if sys.platform == "win32": POLICY_READ: int POLICY_WRITE: int POLICY_EXECUTE: int + class TokenAccess: TOKEN_QUERY: int + class TokenInformationClass: TokenUser: int + class TOKEN_USER(ctypes.Structure): num: int + class SECURITY_DESCRIPTOR(ctypes.Structure): SECURITY_DESCRIPTOR_CONTROL: Any REVISION: int + class SECURITY_ATTRIBUTES(ctypes.Structure): nLength: int lpSecurityDescriptor: Any @@ -78,6 +86,7 @@ if sys.platform == "win32": def descriptor(self) -> Any: ... @descriptor.setter def descriptor(self, value: Any) -> None: ... + def GetTokenInformation(token: Any, information_class: Any) -> Any: ... def OpenProcessToken(proc_handle: Any, access: Any) -> Any: ... def get_current_user() -> TOKEN_USER: ... diff --git a/stubs/paramiko/paramiko/win_pageant.pyi b/stubs/paramiko/paramiko/win_pageant.pyi index ed62937fd..6bca6a3af 100644 --- a/stubs/paramiko/paramiko/win_pageant.pyi +++ b/stubs/paramiko/paramiko/win_pageant.pyi @@ -4,7 +4,9 @@ import sys if sys.platform == "win32": win32con_WM_COPYDATA: int def can_talk_to_agent(): ... + class COPYDATASTRUCT(ctypes.Structure): ... + class PageantConnection: def __init__(self) -> None: ... def send(self, data: bytes) -> None: ... diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index 7b0a1f404..74a8554dd 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -154,9 +154,11 @@ class Process: def cpu_affinity(self, cpus: list[int] | None = ...) -> list[int] | None: ... if sys.platform == "linux": def cpu_num(self) -> int: ... + def environ(self) -> dict[str, str]: ... if sys.platform == "win32": def num_handles(self) -> int: ... + def num_ctx_switches(self) -> pctxsw: ... def num_threads(self) -> int: ... def threads(self) -> list[pthread]: ... @@ -169,6 +171,7 @@ class Process: def memory_percent(self, memtype: str = ...) -> float: ... if sys.platform != "darwin": def memory_maps(self, grouped: bool = ...): ... + def open_files(self) -> list[popenfile]: ... def connections(self, kind: str = ...) -> list[pconn]: ... def send_signal(self, sig: int) -> None: ... diff --git a/stubs/psutil/psutil/_psbsd.pyi b/stubs/psutil/psutil/_psbsd.pyi index 4e276e27b..6a4df8e9a 100644 --- a/stubs/psutil/psutil/_psbsd.pyi +++ b/stubs/psutil/psutil/_psbsd.pyi @@ -141,12 +141,14 @@ class Process: def status(self): ... def io_counters(self): ... def cwd(self): ... + class nt_mmap_grouped(NamedTuple): path: Any rss: Any private: Any ref_count: Any shadow_count: Any + class nt_mmap_ext(NamedTuple): addr: Any perms: Any diff --git a/stubs/python-dateutil/dateutil/rrule.pyi b/stubs/python-dateutil/dateutil/rrule.pyi index bc95dcf2a..44a61b5c1 100644 --- a/stubs/python-dateutil/dateutil/rrule.pyi +++ b/stubs/python-dateutil/dateutil/rrule.pyi @@ -95,6 +95,7 @@ class rruleset(rrulebase): def __gt__(self, other): ... def __eq__(self, other): ... def __ne__(self, other): ... + def __init__(self, cache: bool = ...) -> None: ... def rrule(self, rrule: _rrule): ... def rdate(self, rdate): ... diff --git a/stubs/pyvmomi/pyVmomi/vim/__init__.pyi b/stubs/pyvmomi/pyVmomi/vim/__init__.pyi index a06b01822..c8c47e1a0 100644 --- a/stubs/pyvmomi/pyVmomi/vim/__init__.pyi +++ b/stubs/pyvmomi/pyVmomi/vim/__init__.pyi @@ -36,12 +36,14 @@ class PerformanceManager: counterId: int instance: str def __init__(self, counterId: int, instance: str): ... + class PerfCounterInfo: key: int groupInfo: Any nameInfo: Any rollupType: Any def __getattr__(self, name: str) -> Any: ... # incomplete + class QuerySpec: entity: ManagedEntity metricId: list[PerformanceManager.MetricId] @@ -49,6 +51,7 @@ class PerformanceManager: maxSample: int startTime: datetime def __getattr__(self, name: str) -> Any: ... # incomplete + class EntityMetricBase: entity: ManagedEntity def QueryPerfCounterByLevel(self, collection_level: int) -> list[PerformanceManager.PerfCounterInfo]: ... diff --git a/stubs/pyvmomi/pyVmomi/vmodl/query.pyi b/stubs/pyvmomi/pyVmomi/vmodl/query.pyi index 93e57ff5c..251ab5ca3 100644 --- a/stubs/pyvmomi/pyVmomi/vmodl/query.pyi +++ b/stubs/pyvmomi/pyVmomi/vmodl/query.pyi @@ -10,6 +10,7 @@ class PropertyCollector: all: bool type: type[ManagedEntity] pathSet: list[str] + class TraversalSpec: def __init__( self, *, path: str = ..., skip: bool = ..., type: type[ContainerView] = ..., **kwargs: Any # incomplete @@ -18,9 +19,11 @@ class PropertyCollector: skip: bool type: type[ContainerView] def __getattr__(self, name: str) -> Any: ... # incomplete + class RetrieveOptions: def __init__(self, *, maxObjects: int) -> None: ... maxObjects: int + class ObjectSpec: def __init__( self, *, skip: bool = ..., selectSet: list[PropertyCollector.TraversalSpec] = ..., obj: Any = ... @@ -28,6 +31,7 @@ class PropertyCollector: skip: bool selectSet: list[PropertyCollector.TraversalSpec] obj: Any + class FilterSpec: def __init__( self, @@ -39,6 +43,7 @@ class PropertyCollector: propSet: list[PropertyCollector.PropertySpec] objectSet: list[PropertyCollector.ObjectSpec] def __getattr__(self, name: str) -> Any: ... # incomplete + class ObjectContent: def __init__( self, *, obj: ManagedEntity = ..., propSet: list[DynamicProperty] = ..., **kwargs: Any # incomplete @@ -46,6 +51,7 @@ class PropertyCollector: obj: ManagedEntity propSet: list[DynamicProperty] def __getattr__(self, name: str) -> Any: ... # incomplete + class RetrieveResult: def __init__(self, *, objects: list[PropertyCollector.ObjectContent] = ..., token: str | None = ...) -> None: ... objects: list[PropertyCollector.ObjectContent] diff --git a/stubs/redis/redis/commands/search/__init__.pyi b/stubs/redis/redis/commands/search/__init__.pyi index b08ea3713..5f8452305 100644 --- a/stubs/redis/redis/commands/search/__init__.pyi +++ b/stubs/redis/redis/commands/search/__init__.pyi @@ -18,4 +18,5 @@ class Search(SearchCommands): ): ... def add_document_hash(self, doc_id, score: float = ..., replace: bool = ...): ... def commit(self): ... + def __init__(self, client, index_name: str = ...) -> None: ... diff --git a/stubs/stripe/stripe/stripe_object.pyi b/stubs/stripe/stripe/stripe_object.pyi index 5b496bfb6..76def4e09 100644 --- a/stubs/stripe/stripe/stripe_object.pyi +++ b/stubs/stripe/stripe/stripe_object.pyi @@ -6,6 +6,7 @@ from stripe import api_requestor as api_requestor class StripeObject(dict[Any, Any]): class ReprJSONEncoder(json.JSONEncoder): def default(self, obj): ... + def __init__( self, id: Any | None = ..., diff --git a/stubs/urllib3/urllib3/connection.pyi b/stubs/urllib3/urllib3/connection.pyi index 91a48fe0f..9493332d7 100644 --- a/stubs/urllib3/urllib3/connection.pyi +++ b/stubs/urllib3/urllib3/connection.pyi @@ -11,6 +11,7 @@ if sys.version_info >= (3, 0): from http.client import HTTPConnection as _HTTPConnection, HTTPException as HTTPException else: from httplib import HTTPConnection as _HTTPConnection, HTTPException as HTTPException + class ConnectionError(Exception): ... _TYPE_BODY = bytes | IO[Any] | Iterable[bytes] | str diff --git a/stubs/vobject/vobject/win32tz.pyi b/stubs/vobject/vobject/win32tz.pyi index a36ceb381..32936fbe5 100644 --- a/stubs/vobject/vobject/win32tz.pyi +++ b/stubs/vobject/vobject/win32tz.pyi @@ -9,13 +9,16 @@ if sys.platform == "win32": localkey: Any WEEKS: Any def list_timezones(): ... + class win32tz(datetime.tzinfo): data: Any def __init__(self, name) -> None: ... def utcoffset(self, dt): ... def dst(self, dt): ... def tzname(self, dt): ... + def pickNthWeekday(year, month, dayofweek, hour, minute, whichweek): ... + class win32tz_data: display: Any dstname: Any @@ -33,4 +36,5 @@ if sys.platform == "win32": dsthour: Any dstminute: Any def __init__(self, path) -> None: ... + def valuesToDict(key): ...