Skip to content

Commit

Permalink
remove unneeded use of AbstractContextManager from multiprocessing.sy…
Browse files Browse the repository at this point in the history
…nchronize (#12872)
  • Loading branch information
tungol authored Oct 22, 2024
1 parent e8c2e5b commit e74d9cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stdlib/multiprocessing/synchronize.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import threading
from collections.abc import Callable
from contextlib import AbstractContextManager
from multiprocessing.context import BaseContext
from types import TracebackType
from typing_extensions import TypeAlias
Expand All @@ -14,14 +13,15 @@ class Barrier(threading.Barrier):
self, parties: int, action: Callable[[], object] | None = None, timeout: float | None = None, *ctx: BaseContext
) -> None: ...

class Condition(AbstractContextManager[bool, None]):
class Condition:
def __init__(self, lock: _LockLike | None = None, *, ctx: BaseContext) -> None: ...
def notify(self, n: int = 1) -> None: ...
def notify_all(self) -> None: ...
def wait(self, timeout: float | None = None) -> bool: ...
def wait_for(self, predicate: Callable[[], bool], timeout: float | None = None) -> bool: ...
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
def release(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, /
) -> None: ...
Expand All @@ -34,9 +34,10 @@ class Event:
def wait(self, timeout: float | None = None) -> bool: ...

# Not part of public API
class SemLock(AbstractContextManager[bool, None]):
class SemLock:
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
def release(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, /
) -> None: ...
Expand Down

0 comments on commit e74d9cf

Please sign in to comment.