mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
stdlib: Improve a bunch of __(a)exit__ methods (#7571)
This commit is contained in:
@@ -3,6 +3,7 @@ from collections.abc import Callable, Iterable, Sequence
|
||||
from ctypes import _CData, _SimpleCData, c_char
|
||||
from multiprocessing.context import BaseContext
|
||||
from multiprocessing.synchronize import _LockLike
|
||||
from types import TracebackType
|
||||
from typing import Any, Generic, Protocol, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
@@ -82,7 +83,9 @@ class SynchronizedBase(Generic[_CT]):
|
||||
def get_obj(self) -> _CT: ...
|
||||
def get_lock(self) -> _LockLike: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
def __exit__(
|
||||
self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class Synchronized(SynchronizedBase[_SimpleCData[_T]], Generic[_T]):
|
||||
value: _T
|
||||
|
||||
Reference in New Issue
Block a user