Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
Cpython
Commits
9628136f
Unverified
Commit
9628136f
authored
2 years ago
by
Géry Ogam
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
bpo-47220: Document the optional callback parameter of weakref.WeakMethod (GH-25491)
parent
bf94c653
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Doc/library/weakref.rst
+4
-2
4 additions, 2 deletions
Doc/library/weakref.rst
Misc/NEWS.d/next/Library/2022-04-04-22-54-11.bpo-47220.L9jYu4.rst
+2
-0
2 additions, 0 deletions
...S.d/next/Library/2022-04-04-22-54-11.bpo-47220.L9jYu4.rst
with
6 additions
and
2 deletions
Doc/library/weakref.rst
+
4
−
2
View file @
9628136f
...
...
@@ -143,7 +143,7 @@ See :ref:`__slots__ documentation <slots>` for details.
``ProxyType`` or ``CallableProxyType``, depending on whether *object* is
callable. Proxy objects are not :term:`hashable` regardless of the referent; this
avoids a number of problems related to their fundamentally mutable nature, and
prevent their use as dictionary keys. *callback* is the same as the parameter
prevent
s
their use as dictionary keys. *callback* is the same as the parameter
of the same name to the :func:`ref` function.
Accessing an attribute of the proxy object after the referent is
...
...
@@ -212,7 +212,7 @@ objects.
discarded when no strong reference to it exists any more.
.. class:: WeakMethod(method)
.. class:: WeakMethod(method
[, callback]
)
A custom :class:`ref` subclass which simulates a weak reference to a bound
method (i.e., a method defined on a class and looked up on an instance).
...
...
@@ -238,6 +238,8 @@ objects.
>>> r()
>>>
*callback* is the same as the parameter of the same name to the :func:`ref` function.
.. versionadded:: 3.4
.. class:: finalize(obj, func, /, *args, **kwargs)
...
...
This diff is collapsed.
Click to expand it.
Misc/NEWS.d/next/Library/2022-04-04-22-54-11.bpo-47220.L9jYu4.rst
0 → 100644
+
2
−
0
View file @
9628136f
Document the optional *callback* parameter of :class:`WeakMethod`. Patch by
Géry Ogam.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment