https://github.com/python/cpython/commit/2d184b26df0c6996a1b0617820b6807def8d53b4 commit: 2d184b26df0c6996a1b0617820b6807def8d53b4 branch: 3.11 author: Miss Islington (bot) <[email protected]> committer: AA-Turner <[email protected]> date: 2024-01-12T23:01:09Z summary:
[3.11] Link to the glossary for "magic methods" in ``MagicMock`` (GH-111292) (#114003) Link to the glossary for "magic methods" in ``MagicMock`` (GH-111292) The MagicMock documentation mentions magic methods several times without actually pointing to the term in the glossary. This can be helpful for people to fully understand what those magic methods are. (cherry picked from commit e97da8677f7bbc6d970e230d334cd646ab662af1) Co-authored-by: Pierre Equoy <[email protected]> files: M Doc/library/unittest.mock.rst diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index 098ba2d7827ab1..75d8a6c9bdee3f 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -1958,8 +1958,8 @@ Mocking Magic Methods ~~~~~~~~~~~~~~~~~~~~~ :class:`Mock` supports mocking the Python protocol methods, also known as -"magic methods". This allows mock objects to replace containers or other -objects that implement Python protocols. +:term:`"magic methods" <magic method>`. This allows mock objects to replace +containers or other objects that implement Python protocols. Because magic methods are looked up differently from normal methods [#]_, this support has been specially implemented. This means that only specific magic @@ -2057,8 +2057,8 @@ There are two ``MagicMock`` variants: :class:`MagicMock` and :class:`NonCallable .. class:: MagicMock(*args, **kw) ``MagicMock`` is a subclass of :class:`Mock` with default implementations - of most of the magic methods. You can use ``MagicMock`` without having to - configure the magic methods yourself. + of most of the :term:`magic methods <magic method>`. You can use + ``MagicMock`` without having to configure the magic methods yourself. The constructor parameters have the same meaning as for :class:`Mock`. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
