diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index fafdf7de6..77e3ea175 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -281,7 +281,7 @@ class HelpFormatter: if sys.version_info >= (3, 14): def __init__( - self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None, color: bool = False + self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None, color: bool = True ) -> None: ... else: def __init__( diff --git a/stdlib/asyncio/__init__.pyi b/stdlib/asyncio/__init__.pyi index 58739816a..23cf57aaa 100644 --- a/stdlib/asyncio/__init__.pyi +++ b/stdlib/asyncio/__init__.pyi @@ -41,14 +41,11 @@ if sys.platform == "win32": "Server", # from base_events "iscoroutinefunction", # from coroutines "iscoroutine", # from coroutines - "_AbstractEventLoopPolicy", # from events "AbstractEventLoop", # from events "AbstractServer", # from events "Handle", # from events "TimerHandle", # from events - "_get_event_loop_policy", # from events "get_event_loop_policy", # from events - "_set_event_loop_policy", # from events "set_event_loop_policy", # from events "get_event_loop", # from events "set_event_loop", # from events @@ -517,14 +514,11 @@ else: "Server", # from base_events "iscoroutinefunction", # from coroutines "iscoroutine", # from coroutines - "_AbstractEventLoopPolicy", # from events "AbstractEventLoop", # from events "AbstractServer", # from events "Handle", # from events "TimerHandle", # from events - "_get_event_loop_policy", # from events "get_event_loop_policy", # from events - "_set_event_loop_policy", # from events "set_event_loop_policy", # from events "get_event_loop", # from events "set_event_loop", # from events @@ -610,7 +604,6 @@ else: "DatagramTransport", # from transports "SubprocessTransport", # from transports "SelectorEventLoop", # from unix_events - "_DefaultEventLoopPolicy", # from unix_events "EventLoop", # from unix_events ) elif sys.version_info >= (3, 13): diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 688ef3ed0..6cceff71c 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -28,14 +28,11 @@ if sys.version_info < (3, 14): # Keep asyncio.__all__ updated with any changes to __all__ here if sys.version_info >= (3, 14): __all__ = ( - "_AbstractEventLoopPolicy", "AbstractEventLoop", "AbstractServer", "Handle", "TimerHandle", - "_get_event_loop_policy", "get_event_loop_policy", - "_set_event_loop_policy", "set_event_loop_policy", "get_event_loop", "set_event_loop", diff --git a/stdlib/asyncio/unix_events.pyi b/stdlib/asyncio/unix_events.pyi index 49f200dcd..b2bf22a27 100644 --- a/stdlib/asyncio/unix_events.pyi +++ b/stdlib/asyncio/unix_events.pyi @@ -16,7 +16,7 @@ _Ts = TypeVarTuple("_Ts") # Keep asyncio.__all__ updated with any changes to __all__ here if sys.platform != "win32": if sys.version_info >= (3, 14): - __all__ = ("SelectorEventLoop", "_DefaultEventLoopPolicy", "EventLoop") + __all__ = ("SelectorEventLoop", "EventLoop") elif sys.version_info >= (3, 13): # Adds EventLoop __all__ = ( diff --git a/stdlib/concurrent/futures/__init__.pyi b/stdlib/concurrent/futures/__init__.pyi index dd1f6da80..ad4d20ea5 100644 --- a/stdlib/concurrent/futures/__init__.pyi +++ b/stdlib/concurrent/futures/__init__.pyi @@ -19,7 +19,7 @@ from .thread import ThreadPoolExecutor as ThreadPoolExecutor if sys.version_info >= (3, 14): from .interpreter import InterpreterPoolExecutor as InterpreterPoolExecutor - __all__ = ( + __all__ = [ "FIRST_COMPLETED", "FIRST_EXCEPTION", "ALL_COMPLETED", @@ -34,7 +34,7 @@ if sys.version_info >= (3, 14): "ProcessPoolExecutor", "ThreadPoolExecutor", "InterpreterPoolExecutor", - ) + ] elif sys.version_info >= (3, 13): __all__ = ( diff --git a/stdlib/html/parser.pyi b/stdlib/html/parser.pyi index 5d38c9c0d..45336f03a 100644 --- a/stdlib/html/parser.pyi +++ b/stdlib/html/parser.pyi @@ -1,9 +1,15 @@ +import sys from _markupbase import ParserBase from re import Pattern +from typing import Final __all__ = ["HTMLParser"] class HTMLParser(ParserBase): + CDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] + if sys.version_info >= (3, 14): + RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] + def __init__(self, *, convert_charrefs: bool = True) -> None: ... def feed(self, data: str) -> None: ... def close(self) -> None: ... @@ -17,7 +23,6 @@ class HTMLParser(ParserBase): def handle_comment(self, data: str) -> None: ... def handle_decl(self, decl: str) -> None: ... def handle_pi(self, data: str) -> None: ... - CDATA_CONTENT_ELEMENTS: tuple[str, ...] def check_for_whole_start_tag(self, i: int) -> int: ... # undocumented def clear_cdata_mode(self) -> None: ... # undocumented def goahead(self, end: bool) -> None: ... # undocumented @@ -26,7 +31,10 @@ class HTMLParser(ParserBase): def parse_html_declaration(self, i: int) -> int: ... # undocumented def parse_pi(self, i: int) -> int: ... # undocumented def parse_starttag(self, i: int) -> int: ... # undocumented - def set_cdata_mode(self, elem: str) -> None: ... # undocumented + if sys.version_info >= (3, 14): + def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented + else: + def set_cdata_mode(self, elem: str) -> None: ... # undocumented rawdata: str # undocumented cdata_elem: str | None # undocumented convert_charrefs: bool # undocumented diff --git a/stdlib/string/templatelib.pyi b/stdlib/string/templatelib.pyi index 3f460006a..ad127e2c5 100644 --- a/stdlib/string/templatelib.pyi +++ b/stdlib/string/templatelib.pyi @@ -1,8 +1,8 @@ from collections.abc import Iterator from types import GenericAlias -from typing import Any, Literal, final +from typing import Any, Literal, TypeVar, final, overload -__all__ = ["Interpolation", "Template"] +_T = TypeVar("_T") @final class Template: # TODO: consider making `Template` generic on `TypeVarTuple` @@ -29,3 +29,8 @@ class Interpolation: cls, value: Any, expression: str = "", conversion: Literal["a", "r", "s"] | None = None, format_spec: str = "" ) -> Interpolation: ... def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... + +@overload +def convert(obj: _T, /, conversion: None) -> _T: ... +@overload +def convert(obj: object, /, conversion: Literal["r", "s", "a"]) -> str: ... diff --git a/stdlib/zipfile/__init__.pyi b/stdlib/zipfile/__init__.pyi index 27c1ef024..220ae02c3 100644 --- a/stdlib/zipfile/__init__.pyi +++ b/stdlib/zipfile/__init__.pyi @@ -254,9 +254,6 @@ class ZipFile: ) -> None: ... if sys.version_info >= (3, 11): def mkdir(self, zinfo_or_directory_name: str | ZipInfo, mode: int = 0o777) -> None: ... - if sys.version_info >= (3, 14): - @property - def data_offset(self) -> int | None: ... def __del__(self) -> None: ...