diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index 619e329bf..e39f1b3c3 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -123,7 +123,6 @@ class SSLProtocol(protocols.Protocol): def connection_lost(self, exc: BaseException | None) -> None: ... def pause_writing(self) -> None: ... def resume_writing(self) -> None: ... - def data_received(self, data: bytes) -> None: ... def eof_received(self) -> None: ... def _get_extra_info(self, name: str, default: Any | None = ...) -> Any: ... def _start_shutdown(self) -> None: ... @@ -133,7 +132,9 @@ class SSLProtocol(protocols.Protocol): 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: ... - def _finalize(self) -> None: ... def _abort(self) -> None: ... + if sys.version_info < (3, 11): + def _finalize(self) -> None: ... + def _process_write_backlog(self) -> None: ... + def data_received(self, data: bytes) -> None: ... diff --git a/stdlib/asyncio/trsock.pyi b/stdlib/asyncio/trsock.pyi index 20df2a78a..b8972e43d 100644 --- a/stdlib/asyncio/trsock.pyi +++ b/stdlib/asyncio/trsock.pyi @@ -14,7 +14,6 @@ _CMSG: TypeAlias = tuple[int, int, bytes] class TransportSocket: def __init__(self, sock: socket.socket) -> None: ... - def _na(self, what: str) -> None: ... @property def family(self) -> int: ... @property @@ -41,6 +40,7 @@ class TransportSocket: def gettimeout(self) -> float | None: ... def setblocking(self, flag: bool) -> None: ... if sys.version_info < (3, 11): + def _na(self, what: str) -> None: ... def accept(self) -> tuple[socket.socket, _RetAddress]: ... def connect(self, address: _Address | bytes) -> None: ... def connect_ex(self, address: _Address | bytes) -> int: ... diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 829ade96c..9691aeac7 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -78,9 +78,7 @@ class NullTranslations: def _parse(self, fp: _TranslationsReader) -> None: ... def add_fallback(self, fallback: NullTranslations) -> None: ... def gettext(self, message: str) -> str: ... - def lgettext(self, message: str) -> str: ... def ngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... - def lngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... 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: ... @@ -90,6 +88,8 @@ class NullTranslations: if sys.version_info < (3, 11): def output_charset(self) -> str | None: ... def set_output_charset(self, charset: str) -> None: ... + def lgettext(self, message: str) -> str: ... + def lngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... def install(self, names: Container[str] | None = ...) -> None: ... diff --git a/stdlib/importlib/metadata/_meta.pyi b/stdlib/importlib/metadata/_meta.pyi index a1101df0d..6a7cd858c 100644 --- a/stdlib/importlib/metadata/_meta.pyi +++ b/stdlib/importlib/metadata/_meta.pyi @@ -1,3 +1,4 @@ +import sys from collections.abc import Iterator from typing import Any, Protocol, TypeVar @@ -14,6 +15,9 @@ class PackageMetadata(Protocol): class SimplePath(Protocol): def joinpath(self) -> SimplePath: ... - def __div__(self) -> SimplePath: ... def parent(self) -> SimplePath: ... def read_text(self) -> str: ... + if sys.version_info >= (3, 11): + def __truediv__(self) -> SimplePath: ... + else: + def __div__(self) -> SimplePath: ... diff --git a/stdlib/modulefinder.pyi b/stdlib/modulefinder.pyi index cd01e0e13..caed7efad 100644 --- a/stdlib/modulefinder.pyi +++ b/stdlib/modulefinder.pyi @@ -3,12 +3,13 @@ from collections.abc import Container, Iterable, Iterator, Sequence from types import CodeType from typing import IO, Any -LOAD_CONST: int # undocumented -IMPORT_NAME: int # undocumented -STORE_NAME: int # undocumented -STORE_GLOBAL: int # undocumented -STORE_OPS: tuple[int, int] # undocumented -EXTENDED_ARG: int # undocumented +if sys.version_info < (3, 11): + LOAD_CONST: int # undocumented + IMPORT_NAME: int # undocumented + STORE_NAME: int # undocumented + STORE_GLOBAL: int # undocumented + STORE_OPS: tuple[int, int] # undocumented + EXTENDED_ARG: int # undocumented packagePathMap: dict[str, list[str]] # undocumented diff --git a/stdlib/pdb.pyi b/stdlib/pdb.pyi index e787b4a4c..3c2cabe8a 100644 --- a/stdlib/pdb.pyi +++ b/stdlib/pdb.pyi @@ -74,7 +74,9 @@ class Pdb(Bdb, Cmd): def print_stack_trace(self) -> None: ... def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = ...) -> None: ... def lookupmodule(self, filename: str) -> str | None: ... - def _runscript(self, filename: str) -> None: ... + if sys.version_info < (3, 11): + def _runscript(self, filename: str) -> None: ... + def do_commands(self, arg: str) -> bool | None: ... def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ... def do_tbreak(self, arg: str) -> bool | None: ... @@ -165,7 +167,7 @@ class Pdb(Bdb, Cmd): complete_whatis = _complete_expression complete_display = _complete_expression - if sys.version_info >= (3, 7): + if sys.version_info >= (3, 7) and sys.version_info < (3, 11): def _runmodule(self, module_name: str) -> None: ... # undocumented diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index c6a6836e6..49f3825e0 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -39,7 +39,8 @@ non_hierarchical: list[str] uses_query: list[str] uses_fragment: list[str] scheme_chars: str -MAX_CACHE_SIZE: int +if sys.version_info < (3, 11): + MAX_CACHE_SIZE: int class _ResultMixinBase(Generic[AnyStr]): def geturl(self) -> AnyStr: ...