Commit b3c92c6a authored by Inada Naoki's avatar Inada Naoki Committed by GitHub

bpo-36597: fix weakref example code (GH-12779)

Commit 57b1a286 fixed doctest, but example code is not
match with document.
Just skip doctest for the block.
parent 2b00db68
...@@ -489,11 +489,14 @@ Unless you set the :attr:`~finalize.atexit` attribute to ...@@ -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 :const:`False`, a finalizer will be called when the program exits if it
is still alive. For instance is still alive. For instance
>>> obj = Object() .. doctest::
>>> weakref.finalize(obj, print, "obj dead or exiting") #doctest:+ELLIPSIS :options: +SKIP
<finalize object at ...; for 'Object' at ...>
>>> del obj >>> obj = Object()
obj dead or exiting >>> 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 Comparing finalizers with :meth:`__del__` methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment