8000 [3.7] Update weakref.rst (GH-14098) by miss-islington · Pull Request #14106 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.7] Update weakref.rst (GH-14098) #14106

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

Merged
merged 1 commit into from
Jun 15, 2019
Merged
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
11 changes: 6 additions & 5 deletions Doc/library/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ exposed by the :mod:`weakref` module for the benefit of advanced uses.

Not all objects can be weakly referenced; those objects which can include class
instances, functions written in Python (but not in C), instance methods, sets,
frozensets, some :term:`file objects <file object>`, :term:`generator`\s, type
objects, sockets, arrays, deques, regular expression pattern objects, and code
frozensets, some :term:`file objects <file object>`, :term:`generators <generator>`,
type objects, sockets, arrays, deques, regular expression pattern objects, and code
objects.

.. versionchanged:: 3.2
Expand All @@ -80,9 +80,10 @@ support weak references but can add support through subclassing::

obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable

Other built-in types such as :class:`tuple` and :class:`int` do not support weak
references even when subclassed (This is an implementation detail and may be
different across various Python implementations.).
.. impl-detail::

Other built-in types such as :class:`tuple` and :class:`int` do not support weak
references even when subclassed.

Extension types can easily be made to support weak references; see
:ref:`weakref-support`.
Expand Down
0