diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-04-11 10:05:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-11 10:05:32 (GMT) |
commit | b3c92c6ae923ffb2b9ac5f80b28ecd689de48662 (patch) | |
tree | d6736faf9c51f9c8ef4e9bc930c5df9967fd9a61 /Doc/library/weakref.rst | |
parent | 2b00db68554422ec37faba2a80179a0172df6349 (diff) | |
download | cpython-b3c92c6ae923ffb2b9ac5f80b28ecd689de48662.zip cpython-b3c92c6ae923ffb2b9ac5f80b28ecd689de48662.tar.gz cpython-b3c92c6ae923ffb2b9ac5f80b28ecd689de48662.tar.bz2 |
bpo-36597: fix weakref example code (GH-12779)
Commit 57b1a2862 fixed doctest, but example code is not
match with document.
Just skip doctest for the block.
Diffstat (limited to 'Doc/library/weakref.rst')
-rw-r--r-- | Doc/library/weakref.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst index b9e887c..7f3d267 100644 --- a/Doc/library/weakref.rst +++ b/Doc/library/weakref.rst @@ -489,11 +489,14 @@ Unless you set the :attr:`~finalize.atexit` attribute to :const:`False`, a finalizer will be called when the program exits if it is still alive. For instance - >>> obj = Object() - >>> weakref.finalize(obj, print, "obj dead or exiting") #doctest:+ELLIPSIS - <finalize object at ...; for 'Object' at ...> - >>> del obj - obj dead or exiting +.. doctest:: + :options: +SKIP + + >>> obj = Object() + >>> weakref.finalize(obj, print, "obj dead or exiting") + <finalize object at ...; for 'Object' at ...> + >>> exit() + obj dead or exiting Comparing finalizers with :meth:`__del__` methods |