mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Use Generic in weakref finalize (#13158)
This commit is contained in:
committed by
GitHub
parent
c713947801
commit
a078e6f5d3
@@ -172,11 +172,11 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
@overload
|
||||
def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ...
|
||||
|
||||
class finalize: # TODO: This is a good candidate for to be a `Generic[_P, _T]` class
|
||||
def __init__(self, obj: object, func: Callable[_P, Any], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
class finalize(Generic[_P, _T]):
|
||||
def __init__(self, obj: _T, func: Callable[_P, Any], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
def __call__(self, _: Any = None) -> Any | None: ...
|
||||
def detach(self) -> tuple[Any, Any, tuple[Any, ...], dict[str, Any]] | None: ...
|
||||
def peek(self) -> tuple[Any, Any, tuple[Any, ...], dict[str, Any]] | None: ...
|
||||
def detach(self) -> tuple[_T, Callable[_P, Any], tuple[Any, ...], dict[str, Any]] | None: ...
|
||||
def peek(self) -> tuple[_T, Callable[_P, Any], tuple[Any, ...], dict[str, Any]] | None: ...
|
||||
@property
|
||||
def alive(self) -> bool: ...
|
||||
atexit: bool
|
||||
|
||||
Reference in New Issue
Block a user