From c9b5c489a4649f1f12074b48379aec3d60dd0cf2 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Wed, 3 Aug 2022 13:44:15 +0100 Subject: [PATCH] `weakref.finalize`: Remove TODO comment --- stdlib/weakref.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index af960391e85d..6de298da1620 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -124,7 +124,10 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): @overload def __ior__(self: Self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... -class finalize: # TODO: This is a good candidate for to be a `Generic[_P, _T]` class +# In theory this class could probably be made generic over a ParamSpec, +# but in the absence of user complaints or a real-world use case, +# it's probably not worth complicating the stub. +class finalize: def __init__(self, __obj: object, __func: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... def __call__(self, _: Any = ...) -> Any | None: ... def detach(self) -> tuple[Any, Any, tuple[Any, ...], dict[str, Any]] | None: ...