diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py310.txt b/stdlib/@tests/stubtest_allowlists/darwin-py310.txt index 331f922dab66..df6bf0af1b91 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py310.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py310.txt @@ -1,3 +1,11 @@ +# ========= +# Temporary +# ========= + +# Added in Python 3.10.20 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ======= # <= 3.12 # ======= diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py311.txt b/stdlib/@tests/stubtest_allowlists/darwin-py311.txt index 2d8079d43541..b389202caf35 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py311.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py311.txt @@ -1,3 +1,11 @@ +# ========= +# Temporary +# ========= + +# Added in Python 3.11.15 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ============ # 3.11 to 3.12 # ============ diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py312.txt b/stdlib/@tests/stubtest_allowlists/darwin-py312.txt index c81581eb72b2..77684961b29b 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py312.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py312.txt @@ -1,3 +1,11 @@ +# ========= +# Temporary +# ========= + +# Added in Python 3.12.13 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ============ # 3.11 to 3.12 # ============ diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt index 8e59e29c1ecb..bb7f4bba4c2f 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt @@ -3,10 +3,3 @@ # ======= (mmap.MAP_32BIT)? # Exists locally on MacOS but not on GitHub - -# ================ -# Unclear problems -# ================ - -# Added in 3.11.1, flagged by stubtest on Python < 3.14 for unknown reasons -errno.ENOTCAPABLE diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py314.txt b/stdlib/@tests/stubtest_allowlists/darwin-py314.txt index bb7f4bba4c2f..ddd16a1acb74 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py314.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py314.txt @@ -1,3 +1,11 @@ +# ========= +# 3.14 only +# ========= + +# Starting with Python 3.14.1, these methods accept None for some of their +# parameters, but would raise a TypeError with Python 3.14.0. +mmap.mmap.madvise + # ======= # >= 3.13 # ======= diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py39.txt b/stdlib/@tests/stubtest_allowlists/darwin-py39.txt index 59728a27f23c..6c94d5c2030a 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py39.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py39.txt @@ -1,3 +1,11 @@ +# ========= +# Temporary +# ========= + +# Added in Python 3.9.25 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ======= # <= 3.12 # ======= diff --git a/stdlib/@tests/stubtest_allowlists/darwin.txt b/stdlib/@tests/stubtest_allowlists/darwin.txt index 4b8d1d041499..bee977f6d21d 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin.txt @@ -10,14 +10,6 @@ (fcntl.F_SETLEASE)? # GNU extension -# ======= -# <= 3.14 -# ======= - -# Added in Python 3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.10, 3.14.1 (parameter `scripting`) -html.parser.HTMLParser.__init__ - - # ========================================== # Modules that do not exist on MacOS systems # ========================================== diff --git a/stdlib/@tests/stubtest_allowlists/linux-py310.txt b/stdlib/@tests/stubtest_allowlists/linux-py310.txt index 559c5d4ce8bf..7673e9c65d23 100644 --- a/stdlib/@tests/stubtest_allowlists/linux-py310.txt +++ b/stdlib/@tests/stubtest_allowlists/linux-py310.txt @@ -1,6 +1,6 @@ -# ======= -# <= 3.14 -# ======= +# ========= +# Temporary +# ========= # Added in Python 3.10.20 (parameter `scripting`) html.parser.HTMLParser.__init__ diff --git a/stdlib/@tests/stubtest_allowlists/linux-py311.txt b/stdlib/@tests/stubtest_allowlists/linux-py311.txt index ce9d5d89f298..671201251e99 100644 --- a/stdlib/@tests/stubtest_allowlists/linux-py311.txt +++ b/stdlib/@tests/stubtest_allowlists/linux-py311.txt @@ -1,6 +1,6 @@ -# ======= -# <= 3.14 -# ======= +# ========= +# Temporary +# ========= # Added in Python 3.11.15 (parameter `scripting`) html.parser.HTMLParser.__init__ diff --git a/stdlib/@tests/stubtest_allowlists/linux-py312.txt b/stdlib/@tests/stubtest_allowlists/linux-py312.txt index 602a661fbc95..9ce8bbf9e13b 100644 --- a/stdlib/@tests/stubtest_allowlists/linux-py312.txt +++ b/stdlib/@tests/stubtest_allowlists/linux-py312.txt @@ -1,6 +1,6 @@ -# ======= -# <= 3.14 -# ======= +# ========= +# Temporary +# ========= # Added in Python 3.12.13 (parameter `scripting`) html.parser.HTMLParser.__init__ diff --git a/stdlib/@tests/stubtest_allowlists/linux-py313.txt b/stdlib/@tests/stubtest_allowlists/linux-py313.txt deleted file mode 100644 index 672b0cf50e09..000000000000 --- a/stdlib/@tests/stubtest_allowlists/linux-py313.txt +++ /dev/null @@ -1,6 +0,0 @@ -# ======= -# <= 3.14 -# ======= - -# Added in Python 3.13.10 (parameter `scripting`) -html.parser.HTMLParser.__init__ diff --git a/stdlib/@tests/stubtest_allowlists/linux-py314.txt b/stdlib/@tests/stubtest_allowlists/linux-py314.txt index 2e5d4a88255d..98f33e427a30 100644 --- a/stdlib/@tests/stubtest_allowlists/linux-py314.txt +++ b/stdlib/@tests/stubtest_allowlists/linux-py314.txt @@ -1,6 +1,7 @@ -# ======= -# <= 3.14 -# ======= +# ========= +# 3.14 only +# ========= -# Added in Python 3.14.1 (parameter `scripting`) -html.parser.HTMLParser.__init__ +# Starting with Python 3.14.1, these methods accept None for some of their +# parameters, but would raise a TypeError with Python 3.14.0. +mmap.mmap.madvise diff --git a/stdlib/@tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt index b7dc763c7248..37eb5d038cad 100644 --- a/stdlib/@tests/stubtest_allowlists/py310.txt +++ b/stdlib/@tests/stubtest_allowlists/py310.txt @@ -1,3 +1,15 @@ +# ========= +# Temporary +# ========= + + +# Will be added in 3.10.20 +pyexpat.XMLParserType.SetAllocTrackerActivationThreshold +pyexpat.XMLParserType.SetAllocTrackerMaximumAmplification +xml.parsers.expat.XMLParserType.SetAllocTrackerActivationThreshold +xml.parsers.expat.XMLParserType.SetAllocTrackerMaximumAmplification + + # ========================= # New errors in Python 3.10 # ========================= diff --git a/stdlib/@tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt index fe0b34206cf9..1f36410deb4e 100644 --- a/stdlib/@tests/stubtest_allowlists/py311.txt +++ b/stdlib/@tests/stubtest_allowlists/py311.txt @@ -1,3 +1,15 @@ +# ========= +# Temporary +# ========= + + +# Will be added in 3.11.15 +pyexpat.XMLParserType.SetAllocTrackerActivationThreshold +pyexpat.XMLParserType.SetAllocTrackerMaximumAmplification +xml.parsers.expat.XMLParserType.SetAllocTrackerActivationThreshold +xml.parsers.expat.XMLParserType.SetAllocTrackerMaximumAmplification + + # ========================= # New errors in Python 3.11 # ========================= diff --git a/stdlib/@tests/stubtest_allowlists/py312.txt b/stdlib/@tests/stubtest_allowlists/py312.txt index ef1c5d12bf4a..d21fdfff468d 100644 --- a/stdlib/@tests/stubtest_allowlists/py312.txt +++ b/stdlib/@tests/stubtest_allowlists/py312.txt @@ -1,3 +1,14 @@ +# ========= +# Temporary +# ========= + +# Will be added in 3.12.13 +pyexpat.XMLParserType.SetAllocTrackerActivationThreshold +pyexpat.XMLParserType.SetAllocTrackerMaximumAmplification +xml.parsers.expat.XMLParserType.SetAllocTrackerActivationThreshold +xml.parsers.expat.XMLParserType.SetAllocTrackerMaximumAmplification + + # ========================= # New errors in Python 3.12 # ========================= diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index d3fd3a15592a..ddb0c396a0da 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -43,6 +43,13 @@ importlib.util.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined threading.Condition.locked multiprocessing.dummy.Condition.locked +# Starting with Python 3.14.1, these methods accept None for some of their +# parameters, but would raise a TypeError with Python 3.14.0. +mmap.mmap.find +mmap.mmap.flush +mmap.mmap.rfind +multiprocessing.process.BaseProcess.__init__ + # ==================================== # Pre-existing errors from Python 3.13 # ==================================== diff --git a/stdlib/@tests/stubtest_allowlists/win32-py310.txt b/stdlib/@tests/stubtest_allowlists/win32-py310.txt index a49447e799b3..1c26b320d918 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py310.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py310.txt @@ -1,6 +1,9 @@ -# ======= -# <= 3.12 -# ======= +# ========= +# Temporary +# ========= + +# Added in Python 3.10.20 (parameter `scripting`) +html.parser.HTMLParser.__init__ # Added in Python 3.10.18 (parameter `escapable`) html.parser.HTMLParser.set_cdata_mode diff --git a/stdlib/@tests/stubtest_allowlists/win32-py311.txt b/stdlib/@tests/stubtest_allowlists/win32-py311.txt index 62c544055dcc..bcc6d7c17ad4 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py311.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py311.txt @@ -1,6 +1,9 @@ -# ======= -# <= 3.12 -# ======= +# ========= +# Temporary +# ========= + +# Added in Python 3.11.15 (parameter `scripting`) +html.parser.HTMLParser.__init__ # Added in Python 3.11.13 (parameter `escapable`) html.parser.HTMLParser.set_cdata_mode diff --git a/stdlib/@tests/stubtest_allowlists/win32-py312.txt b/stdlib/@tests/stubtest_allowlists/win32-py312.txt index 1c808d36db4e..c977d31f24eb 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py312.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py312.txt @@ -1,3 +1,11 @@ +# ========= +# Temporary +# ========= + +# Added in Python 3.12.13 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ======= # >= 3.12 # ======= diff --git a/stdlib/@tests/stubtest_allowlists/win32-py39.txt b/stdlib/@tests/stubtest_allowlists/win32-py39.txt index ace75c0b6c20..26af9746ff27 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py39.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py39.txt @@ -1,6 +1,9 @@ -# ======= -# <= 3.12 -# ======= +# ========= +# Temporary +# ========= + +# Added in Python 3.9.25 (parameter `scripting`) +html.parser.HTMLParser.__init__ # Added in Python 3.9.23 (parameter `escapable`) html.parser.HTMLParser.set_cdata_mode diff --git a/stdlib/@tests/stubtest_allowlists/win32.txt b/stdlib/@tests/stubtest_allowlists/win32.txt index 1ac5529e7ebe..66695e1d87d3 100644 --- a/stdlib/@tests/stubtest_allowlists/win32.txt +++ b/stdlib/@tests/stubtest_allowlists/win32.txt @@ -9,14 +9,6 @@ _winapi.OpenFileMapping _winapi.VirtualQuerySize -# ======= -# <= 3.14 -# ======= - -# Added in Python 3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.10, 3.14.1 (parameter `scripting`) -html.parser.HTMLParser.__init__ - - # ============================================ # Modules that do not exist on Windows systems # ============================================ diff --git a/stdlib/heapq.pyi b/stdlib/heapq.pyi index 220c41f303fb..ff8ba7ff1f82 100644 --- a/stdlib/heapq.pyi +++ b/stdlib/heapq.pyi @@ -1,3 +1,4 @@ +import sys from _heapq import * from _typeshed import SupportsRichComparison from collections.abc import Callable, Generator, Iterable @@ -5,6 +6,10 @@ from typing import Any, Final, TypeVar __all__ = ["heappush", "heappop", "heapify", "heapreplace", "merge", "nlargest", "nsmallest", "heappushpop"] +if sys.version_info >= (3, 14): + # Added to __all__ in 3.14.1 + __all__ += ["heapify_max", "heappop_max", "heappush_max", "heappushpop_max", "heapreplace_max"] + _S = TypeVar("_S") __about__: Final[str] diff --git a/stdlib/mmap.pyi b/stdlib/mmap.pyi index 8a5baba62914..98183acba40f 100644 --- a/stdlib/mmap.pyi +++ b/stdlib/mmap.pyi @@ -54,28 +54,28 @@ class mmap: ) -> Self: ... def close(self) -> None: ... - def flush(self, offset: int = 0, size: int = ...) -> None: ... - def move(self, dest: int, src: int, count: int) -> None: ... + def flush(self, offset: int = 0, size: int = ..., /) -> None: ... + def move(self, dest: int, src: int, count: int, /) -> None: ... def read_byte(self) -> int: ... def readline(self) -> bytes: ... - def resize(self, newsize: int) -> None: ... + def resize(self, newsize: int, /) -> None: ... if sys.platform != "win32": - def seek(self, pos: int, whence: Literal[0, 1, 2, 3, 4] = os.SEEK_SET) -> None: ... + def seek(self, pos: int, whence: Literal[0, 1, 2, 3, 4] = os.SEEK_SET, /) -> None: ... else: - def seek(self, pos: int, whence: Literal[0, 1, 2] = os.SEEK_SET) -> None: ... + def seek(self, pos: int, whence: Literal[0, 1, 2] = os.SEEK_SET, /) -> None: ... def size(self) -> int: ... def tell(self) -> int: ... - def write_byte(self, byte: int) -> None: ... + def write_byte(self, byte: int, /) -> None: ... def __len__(self) -> int: ... closed: bool if sys.platform != "win32": - def madvise(self, option: int, start: int = 0, length: int = ...) -> None: ... + def madvise(self, option: int, start: int = 0, 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 = None) -> bytes: ... - def write(self, bytes: ReadableBuffer) -> int: ... + def find(self, view: ReadableBuffer, start: int = ..., end: int = ..., /) -> int: ... + def rfind(self, view: ReadableBuffer, start: int = ..., end: int = ..., /) -> int: ... + def read(self, n: int | None = None, /) -> bytes: ... + def write(self, bytes: ReadableBuffer, /) -> int: ... @overload def __getitem__(self, key: int, /) -> int: ... @overload @@ -92,7 +92,7 @@ class mmap: # so we claim that there is also an __iter__ to help type checkers. def __iter__(self) -> Iterator[int]: ... def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... + def __exit__(self, exc_type: Unused, exc_value: Unused, traceback: Unused, /) -> None: ... def __buffer__(self, flags: int, /) -> memoryview: ... def __release_buffer__(self, buffer: memoryview, /) -> None: ... if sys.version_info >= (3, 13): diff --git a/stdlib/multiprocessing/dummy/__init__.pyi b/stdlib/multiprocessing/dummy/__init__.pyi index 3cbeeb057791..62fef2b080f2 100644 --- a/stdlib/multiprocessing/dummy/__init__.pyi +++ b/stdlib/multiprocessing/dummy/__init__.pyi @@ -1,4 +1,5 @@ import array +import sys import threading import weakref from collections.abc import Callable, Iterable, Mapping, Sequence @@ -44,14 +45,25 @@ class DummyProcess(threading.Thread): _start_called: int @property def exitcode(self) -> Literal[0] | None: ... - def __init__( - self, - group: Any = None, - target: Callable[..., object] | None = None, - name: str | None = None, - args: Iterable[Any] = (), - kwargs: Mapping[str, Any] = {}, - ) -> None: ... + if sys.version_info >= (3, 14): + # Default changed in Python 3.14.1 + def __init__( + self, + group: Any = None, + target: Callable[..., object] | None = None, + name: str | None = None, + args: Iterable[Any] = (), + kwargs: Mapping[str, Any] | None = None, + ) -> None: ... + else: + def __init__( + self, + group: Any = None, + target: Callable[..., object] | None = None, + name: str | None = None, + args: Iterable[Any] = (), + kwargs: Mapping[str, Any] | None = {}, + ) -> None: ... Process = DummyProcess diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index bb0a57153948..5d0a536bced9 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -174,7 +174,8 @@ __all__ = [ "write", ] if sys.version_info >= (3, 14): - __all__ += ["readinto"] + # reload_environ was added to __all__ in Python 3.14.1 + __all__ += ["readinto", "reload_environ"] if sys.platform == "darwin" and sys.version_info >= (3, 12): __all__ += ["PRIO_DARWIN_BG", "PRIO_DARWIN_NONUI", "PRIO_DARWIN_PROCESS", "PRIO_DARWIN_THREAD"] if sys.platform == "darwin" and sys.version_info >= (3, 10): diff --git a/stdlib/pdb.pyi b/stdlib/pdb.pyi index 2f114b20572d..f936e94cda90 100644 --- a/stdlib/pdb.pyi +++ b/stdlib/pdb.pyi @@ -201,8 +201,8 @@ class Pdb(Bdb, Cmd): def completenames(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override] if sys.version_info >= (3, 12): def set_convenience_variable(self, frame: FrameType, name: str, value: Any) -> None: ... - if sys.version_info >= (3, 13) and sys.version_info < (3, 14): - # Added in 3.13.8. + if sys.version_info >= (3, 13): + # Added in 3.13.8 and 3.14.1 @property def rlcompleter(self) -> type[Completer]: ... diff --git a/stdlib/pyexpat/__init__.pyi b/stdlib/pyexpat/__init__.pyi index 21e676052098..bc522d5f3c92 100644 --- a/stdlib/pyexpat/__init__.pyi +++ b/stdlib/pyexpat/__init__.pyi @@ -1,3 +1,4 @@ +import sys from _typeshed import ReadableBuffer, SupportsRead from collections.abc import Callable from pyexpat import errors as errors, model as model @@ -29,6 +30,11 @@ class XMLParserType: def UseForeignDTD(self, flag: bool = True, /) -> None: ... def GetReparseDeferralEnabled(self) -> bool: ... def SetReparseDeferralEnabled(self, enabled: bool, /) -> None: ... + if sys.version_info >= (3, 10): + # Added in Python 3.10.20, 3.11.15, 3.12.3, 3.13.10, 3.14.1 + def SetAllocTrackerActivationThreshold(self, threshold: int, /) -> None: ... + def SetAllocTrackerMaximumAmplification(self, max_factor: float, /) -> None: ... + @property def intern(self) -> dict[str, str]: ... buffer_size: int