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: Remove support of special method __div__ in unittest.mock
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lukasz.langa, michael.foord, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2021-08-26 06:49 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27965 merged serhiy.storchaka, 2021-08-26 06:56
Messages (4)
msg400314 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-26 06:49
Special method __div__ was used in Python 2, but is not used in Python 3. I think it can be removed from the list of supported special methods in unittest.mock.
msg400315 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-26 06:51
It was kept in the previous clean up in issue23641 because I had doubts. But now I do not see reasons to keep it. Rather keeping it can confuse users.
msg400362 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-26 18:19
New changeset f9cd40f5e242d3c64cc20a5064500f5fe864f91f by Serhiy Storchaka in branch 'main':
bpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965)
https://github.com/python/cpython/commit/f9cd40f5e242d3c64cc20a5064500f5fe864f91f
msg400364 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-26 18:30
Agreed, let's get rid of it. Thanks!

I grepped for this and there's still one left-over here:

https://github.com/python/cpython/blob/f9cd40f5e242d3c64cc20a5064500f5fe864f91f/Lib/importlib/metadata/_meta.py#L40-L41

Fortunately, this was already fixed upstream:

https://github.com/python/importlib_metadata/issues/334

Next time Jason syncs importlib.metadata with upstream this will be solved as well. Currently we're synced with 4.6.0 while the fix went in in 4.6.4.

Also fortunately, this is low-pri since this is only in type annotations.
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89173
2021-08-26 18:30:32lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg400364

stage: patch review -> resolved
2021-08-26 18:19:51lukasz.langasetnosy: + lukasz.langa
messages: + msg400362
2021-08-26 06:56:22serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request26412
2021-08-26 06:51:17serhiy.storchakasetmessages: + msg400315
2021-08-26 06:49:49serhiy.storchakacreate