Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix doctests.
  • Loading branch information
serhiy-storchaka committed Dec 9, 2022
commit 29ef7e646e85377ef7bf81f0f7bf7469284f2749
2 changes: 1 addition & 1 deletion Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ The :mod:`functools` module defines the following functions:
attribute::

>>> fun.registry.keys()
dict_keys([<class 'NoneType'>, <class 'int'>, <class 'object'>,
dict_keys([<class 'types.NoneType'>, <class 'int'>, <class 'object'>,
<class 'decimal.Decimal'>, <class 'list'>,
<class 'float'>])
>>> fun.registry[float]
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ process which created it.
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
AttributeError: 'module' object has no attribute 'f'
AttributeError: 'module' object has no attribute 'f'
AttributeError: 'module' object has no attribute 'f'
AttributeError: 'types.ModuleType' object has no attribute 'f'
AttributeError: 'types.ModuleType' object has no attribute 'f'
AttributeError: 'types.ModuleType' object has no attribute 'f'

(If you try this it will actually output three full tracebacks
interleaved in a semi-random fashion, and then you may have to
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/multiprocessing.shared_memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ instance:
>>> from multiprocessing import shared_memory
>>> a = shared_memory.ShareableList(['howdy', b'HoWdY', -273.154, 100, None, True, 42])
>>> [ type(entry) for entry in a ]
[<class 'str'>, <class 'bytes'>, <class 'float'>, <class 'int'>, <class 'NoneType'>, <class 'bool'>, <class 'int'>]
[<class 'str'>, <class 'bytes'>, <class 'float'>, <class 'int'>, <class 'types.NoneType'>, <class 'bool'>, <class 'int'>]
>>> a[2]
-273.154
>>> a[2] = -78.5
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ object::
...
>>> mock = MagicMock(async_func)
>>> mock
<MagicMock spec='function' id='...'>
<MagicMock spec='FunctionType' id='...'>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not types.FunctionType?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the MagicMock repr contains only spec_class.__name__, not the fully qualified name.

>>> mock() # doctest: +SKIP
<coroutine object AsyncMockMixin._mock_call at ...>

Expand Down