[Python-checkins] bpo-35918: Remove broken has_key method and add test (GH-11819) (#11824)

Giampaolo Rodola webhook-mailer at python.org
Mon Feb 11 20:09:30 EST 2019


https://github.com/python/cpython/commit/58f05ce059cc5207320fef27a9fbc0ffdc2b1d1a
commit: 58f05ce059cc5207320fef27a9fbc0ffdc2b1d1a
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Giampaolo Rodola <g.rodola at gmail.com>
date: 2019-02-11T17:09:22-08:00
summary:

bpo-35918: Remove broken has_key method and add test (GH-11819) (#11824)

(cherry picked from commit a31f4cc881992e84d351957bd9ac1a92f882fa39)

Co-authored-by: Rémi Lapeyre <remi.lapeyre at henki.fr>

files:
A Misc/NEWS.d/next/Library/2019-02-11-16-23-10.bpo-35918.oGDlpT.rst
M Lib/multiprocessing/managers.py
M Lib/test/_test_multiprocessing.py

diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index dbed993a38d6..4ae8ddc77018 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -1135,7 +1135,7 @@ def __imul__(self, value):
 
 DictProxy = MakeProxyType('DictProxy', (
     '__contains__', '__delitem__', '__getitem__', '__iter__', '__len__',
-    '__setitem__', 'clear', 'copy', 'get', 'has_key', 'items',
+    '__setitem__', 'clear', 'copy', 'get', 'items',
     'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'
     ))
 DictProxy._method_to_typeid_ = {
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index e76c20e9d935..821bfa178304 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -4768,8 +4768,6 @@ def _test_dict(cls, obj):
         assert len(obj) == 1
         assert obj['foo'] == 5
         assert obj.get('foo') == 5
-        # TODO: fix https://bugs.python.org/issue35918
-        # assert obj.has_key('foo')
         assert list(obj.items()) == [('foo', 5)]
         assert list(obj.keys()) == ['foo']
         assert list(obj.values()) == [5]
diff --git a/Misc/NEWS.d/next/Library/2019-02-11-16-23-10.bpo-35918.oGDlpT.rst b/Misc/NEWS.d/next/Library/2019-02-11-16-23-10.bpo-35918.oGDlpT.rst
new file mode 100644
index 000000000000..0fcce3e25085
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-02-11-16-23-10.bpo-35918.oGDlpT.rst
@@ -0,0 +1,2 @@
+Removed broken ``has_key`` method from
+multiprocessing.managers.SyncManager.dict. Contributed by Rémi Lapeyre.



More information about the Python-checkins mailing list