stdlib: Add many missing dunder overrides (#7231)

This commit is contained in:
Alex Waygood
2022-02-16 14:25:47 +00:00
committed by GitHub
parent 409beea616
commit fbc279e3f5
28 changed files with 62 additions and 6 deletions

View File

@@ -1,7 +1,8 @@
import queue
import sys
import threading
from contextlib import AbstractContextManager
from _typeshed import Self
from types import TracebackType
from typing import Any, AnyStr, Callable, Generic, Iterable, Mapping, Sequence, TypeVar
from .connection import Connection
@@ -69,7 +70,7 @@ class Server:
def serve_forever(self) -> None: ...
def accept_connection(self, c: Connection, name: str) -> None: ...
class BaseManager(AbstractContextManager[BaseManager]):
class BaseManager:
def __init__(
self, address: Any | None = ..., authkey: bytes | None = ..., serializer: str = ..., ctx: BaseContext | None = ...
) -> None: ...
@@ -90,12 +91,14 @@ class BaseManager(AbstractContextManager[BaseManager]):
method_to_typeid: Mapping[str, str] | None = ...,
create_method: bool = ...,
) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, exc_type: type[BaseException], exc_val: BaseException, exc_tb: TracebackType) -> None: ...
# Conflicts with method names
_dict = dict
_list = list
class SyncManager(BaseManager, AbstractContextManager[SyncManager]):
class SyncManager(BaseManager):
def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ...
def Condition(self, lock: Any = ...) -> threading.Condition: ...
def Event(self) -> threading.Event: ...