classification
Title: Got rid of bad dunder names
Type: behavior Stage: resolved
Components: Library (Lib), Tests Versions: Python 3.5, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: 23581 Superseder:
Assigned To: Nosy List: berker.peksag, ezio.melotti, martin.panter, michael.foord, pitrou, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-03-11 14:42 by serhiy.storchaka, last changed 2016-06-19 15:34 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
bad_dunder_names.patch serhiy.storchaka, 2015-03-11 14:42 review
Messages (9)
msg237868 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-03-11 14:42
Proposed patch gets rid of uses and mentions of bad dunder names. I.e. names inherited from Python 2: __cmp__, __nonzero__, __getslice__, __unicode__, __div__, etc. They are replaced by correct names (__truediv__, __floordiv__, __eq__, __bool__, etc) or removed. Also fixed typos and other minor bugs. Also added support for __matmul__ and __getnewargs_ex__ in unittest.mock and added tests for __matmul__.
msg237869 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-03-11 14:54
> Also added support for __matmul__ and __getnewargs_ex__ in unittest.mock [...]

See issue 23581 for __matmul__ support.
msg237908 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-03-11 23:32
I’m not very familiar with the mock module so can't comment if removing div is sensible there. But all the other changes seem reasonable. I just left a few suggestions for further tweaks on Rietveld.
msg237976 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-03-12 19:07
Do you want first commit the patch in issue23581 Berker?
msg237978 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-03-12 19:12
> Do you want first commit the patch in issue23581 Berker?

I just committed it. Thanks for the review :)
msg237980 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-03-12 20:01
New changeset 7522bb14e36a by Serhiy Storchaka in branch '3.4':
Issue #23641: Cleaned out legacy dunder names from tests and docs.
https://hg.python.org/cpython/rev/7522bb14e36a

New changeset 9332a545ad85 by Serhiy Storchaka in branch 'default':
Issue #23641: Cleaned out legacy dunder names from tests and docs.
https://hg.python.org/cpython/rev/9332a545ad85
msg237981 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-03-12 20:04
Committed all except changes to multiprocessing.sharedctypes (remove __getslice__ and __setslice__) and unittest.mock (remove __div__, add __getnewargs_ex__).
msg268852 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-19 15:32
New changeset 75cec736f87d by Serhiy Storchaka in branch '3.5':
Issue #23641: Added __getnewargs_ex__ to the list of special mock attributes.
https://hg.python.org/cpython/rev/75cec736f87d

New changeset 4c5f7b61b6c5 by Serhiy Storchaka in branch 'default':
Issue #23641: Added __getnewargs_ex__ to the list of special mock attributes.
https://hg.python.org/cpython/rev/4c5f7b61b6c5
msg268853 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-06-19 15:34
I'm not sure about removing __getslice__ and __setslice__ from multiprocessing.sharedctypes and __div__ from unittest.mock, and left them as is.
History
Date User Action Args
2016-06-19 15:34:19serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg268853

stage: patch review -> resolved
2016-06-19 15:32:30python-devsetmessages: + msg268852
2015-03-12 20:04:10serhiy.storchakasetmessages: + msg237981
2015-03-12 20:01:58python-devsetnosy: + python-dev
messages: + msg237980
2015-03-12 19:12:22berker.peksagsetmessages: + msg237978
2015-03-12 19:07:23serhiy.storchakasetmessages: + msg237976
2015-03-11 23:32:38martin.pantersetnosy: + martin.panter
messages: + msg237908
2015-03-11 15:09:36serhiy.storchakasetdependencies: + unittest.mock.MagicMock doesn't support matmul (@) operator
2015-03-11 14:54:38berker.peksagsetnosy: + berker.peksag
messages: + msg237869
2015-03-11 14:42:14serhiy.storchakacreate