Skip to content

multiprocessing updates for 3.14 #14239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions stdlib/@tests/stubtest_allowlists/py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
# TODO: New errors in Python 3.14 that need to be fixed or moved below
# ====================================================================

multiprocessing.managers.BaseListProxy.clear
multiprocessing.managers.BaseListProxy.copy
multiprocessing.managers.DictProxy.__ior__
multiprocessing.managers._BaseDictProxy.__ior__
multiprocessing.managers._BaseDictProxy.__or__
multiprocessing.managers._BaseDictProxy.__reversed__
multiprocessing.managers._BaseDictProxy.__ror__
multiprocessing.managers._BaseDictProxy.fromkeys
multiprocessing.process.BaseProcess.interrupt
multiprocessing.synchronize.SemLock.locked
tarfile.TarFile.zstopen
tkinter.Event.__class_getitem__

Expand Down
9 changes: 9 additions & 0 deletions stdlib/multiprocessing/managers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ if sys.version_info >= (3, 13):
def keys(self) -> list[_KT]: ... # type: ignore[override]
def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override]
def values(self) -> list[_VT]: ... # type: ignore[override]
if sys.version_info >= (3, 14):
def __ior__(self, value: Mapping[_KT, _VT], /) -> Self: ... # type: ignore[misc]
def __or__(self, value: Mapping[_KT, _VT], /) -> dict[_KT, _VT]: ... # type: ignore[misc]
def __reversed__(self) -> Iterator[_KT]: ... # type: ignore[misc]
def __ror__(self, value: Mapping[_KT, _VT], /) -> dict[_KT, _VT]: ... # type: ignore[misc]
def fromkeys(self, iterable: Iterable[_KT], value: _VT, /) -> dict[_KT, _VT]: ... # type: ignore[misc]

class DictProxy(_BaseDictProxy[_KT, _VT]):
def __class_getitem__(cls, args: Any, /) -> GenericAlias: ...
Expand Down Expand Up @@ -197,6 +203,9 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]):
def sort(self: BaseListProxy[SupportsRichComparisonT], *, key: None = None, reverse: bool = ...) -> None: ...
@overload
def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ...
if sys.version_info >= (3, 14):
def clear(self) -> None: ... # type: ignore[misc]
def copy(self) -> list[_T]: ... # type: ignore[misc]

class ListProxy(BaseListProxy[_T]):
def __iadd__(self, value: Iterable[_T], /) -> Self: ... # type: ignore[override]
Expand Down
3 changes: 3 additions & 0 deletions stdlib/multiprocessing/process.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from collections.abc import Callable, Iterable, Mapping
from typing import Any

Expand Down Expand Up @@ -33,6 +34,8 @@ class BaseProcess:
def pid(self) -> int | None: ...
@property
def sentinel(self) -> int: ...
if sys.version_info >= (3, 14):
def interrupt(self) -> None: ...

def current_process() -> BaseProcess: ...
def active_children() -> list[BaseProcess]: ...
Expand Down
3 changes: 3 additions & 0 deletions stdlib/multiprocessing/synchronize.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import threading
from collections.abc import Callable
from multiprocessing.context import BaseContext
Expand Down Expand Up @@ -45,6 +46,8 @@ class SemLock:
# These methods are copied from the wrapped _multiprocessing.SemLock object
def acquire(self, block: bool = True, timeout: float | None = None) -> bool: ...
def release(self) -> None: ...
if sys.version_info >= (3, 14):
def locked(self) -> bool: ...

class Lock(SemLock):
def __init__(self, *, ctx: BaseContext) -> None: ...
Expand Down
Loading