Issue 23641: Got rid of bad dunder names (original) (raw)

Issue23641

Created on 2015-03-11 14:42 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. 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 Berker?
msg237978 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-03-12 19:12
> Do you want first commit the patch in 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
2022-04-11 14:58:13 admin set github: 67829
2016-06-19 15:34:19 serhiy.storchaka set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2016-06-19 15:32:30 python-dev set messages: +
2015-03-12 20:04:10 serhiy.storchaka set messages: +
2015-03-12 20:01:58 python-dev set nosy: + python-devmessages: +
2015-03-12 19:12:22 berker.peksag set messages: +
2015-03-12 19:07:23 serhiy.storchaka set messages: +
2015-03-11 23:32:38 martin.panter set nosy: + martin.pantermessages: +
2015-03-11 15:09:36 serhiy.storchaka set dependencies: + unittest.mock.MagicMock doesn't support matmul (@) operator
2015-03-11 14:54:38 berker.peksag set nosy: + berker.peksagmessages: +
2015-03-11 14:42:14 serhiy.storchaka create