Use Generic in weakref finalize (#13158)

This commit is contained in:
Konstantin Baikov
2024-12-02 17:34:37 +01:00
committed by GitHub
parent c713947801
commit a078e6f5d3

View File

@@ -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