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.
This commit is contained in:
Inada Naoki 2019-04-11 19:05:32 +09:00 committed by GitHub
parent 2b00db6855
commit b3c92c6ae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -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