This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Odd words in unittest.mock document.
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, ezio.melotti, methane, michael.foord, python-dev
Priority: normal Keywords: patch

Created on 2014-02-02 15:38 by methane, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue20487.diff berker.peksag, 2015-01-05 10:05 review
Messages (7)
msg209993 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2014-02-02 15:38
http://docs.python.org/3.3/library/unittest.mock.html#magic-mock

> The two equality method, __eq__ and __ne__, are special. They do the default equality comparison on identity, using a side effect, unless you change their return value to return something else:

What "using a side effect" means?
msg210007 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2014-02-02 19:39
A "side effect" is a mechanism Mock provides for mocks to have special behaviour when called. 

http://docs.python.org/3.3/library/unittest.mock.html#unittest.mock.Mock.side_effect

The term is used very widely throughout the mock documentation, so I don't think it's appropriate to link *every* usage to the side_effect documentation.
msg211296 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2014-02-15 21:17
Maybe this would be clearer if it used the keyword, i.e. "using the :attr:`~Mock.side_effect` attribute".

Also, there's a typo in the quoted text: "two equality method" should be method'S'.
msg233453 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-01-05 10:05
Here is a patch to address msg211296.
msg233454 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2015-01-05 10:09
Patch looks good, thanks.
msg233599 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-01-07 19:15
New changeset 230a1bfb0f59 by Berker Peksag in branch '3.4':
Issue #20487: Clarify meaning of "side effect" in the magic mock documentation.
https://hg.python.org/cpython/rev/230a1bfb0f59

New changeset 3cf91d2aeab3 by Berker Peksag in branch 'default':
Issue #20487: Clarify meaning of "side effect" in the magic mock documentation.
https://hg.python.org/cpython/rev/3cf91d2aeab3
msg233600 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-01-07 19:19
Fixed. Thank you to both Andrew and Michael.
History
Date User Action Args
2022-04-11 14:57:58adminsetgithub: 64686
2015-01-07 19:19:01berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg233600

stage: patch review -> resolved
2015-01-07 19:15:48python-devsetnosy: + python-dev
messages: + msg233599
2015-01-05 10:09:07michael.foordsetmessages: + msg233454
2015-01-05 10:05:23berker.peksagsetfiles: + issue20487.diff

type: enhancement
versions: - Python 3.3
keywords: + patch
nosy: + berker.peksag

messages: + msg233453
stage: patch review
2014-12-31 16:23:13akuchlingsetnosy: - akuchling
2014-02-15 21:17:58akuchlingsetnosy: + akuchling
messages: + msg211296
2014-02-15 15:55:24ezio.melottisetnosy: + ezio.melotti
2014-02-02 19:39:31michael.foordsetmessages: + msg210007
2014-02-02 15:38:27methanecreate