10000 `weakref.finalize`: Remove TODO comment by AlexWaygood · Pull Request #8476 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

weakref.finalize: Remove TODO comment #8476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion stdlib/weakref.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
0