summaryrefslogtreecommitdiff
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-06-01 11:00:15 +0300
committerGitHub <noreply@github.com>2019-06-01 11:00:15 +0300
commit2085bd0877e17ad4d98a4586d5eabb6faecbb190 (patch)
treec25b20d33ebf4d64a28abb8591f4ff7acf90614c /Lib/multiprocessing
parent4a686504eb2bbf69adf78077458508a7ba131667 (diff)
downloadcpython-git-2085bd0877e17ad4d98a4586d5eabb6faecbb190.tar.gz
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/dummy/__init__.py2
-rw-r--r--Lib/multiprocessing/managers.py11
-rw-r--r--Lib/multiprocessing/pool.py2
3 files changed, 6 insertions, 9 deletions
diff --git a/Lib/multiprocessing/dummy/__init__.py b/Lib/multiprocessing/dummy/__init__.py
index 403f5e5198..6a1468609e 100644
--- a/Lib/multiprocessing/dummy/__init__.py
+++ b/Lib/multiprocessing/dummy/__init__.py
@@ -80,7 +80,7 @@ def freeze_support():
#
class Namespace(object):
- def __init__(self, **kwds):
+ def __init__(self, /, **kwds):
self.__dict__.update(kwds)
def __repr__(self):
items = list(self.__dict__.items())
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index 514152298b..7e1818bb09 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -615,13 +615,10 @@ class BaseManager(object):
util.info('manager serving at %r', server.address)
server.serve_forever()
- def _create(*args, **kwds):
+ def _create(self, typeid, /, *args, **kwds):
'''
Create a new shared object; return the token and exposed tuple
'''
- self, typeid, *args = args
- args = tuple(args)
-
assert self._state.value == State.STARTED, 'server not yet started'
conn = self._Client(self._address, authkey=self._authkey)
try:
@@ -738,7 +735,7 @@ class BaseManager(object):
)
if create_method:
- def temp(self, *args, **kwds):
+ def temp(self, /, *args, **kwds):
util.debug('requesting creation of a shared %r object', typeid)
token, exp = self._create(typeid, *args, **kwds)
proxy = proxytype(
@@ -978,7 +975,7 @@ def MakeProxyType(name, exposed, _cache={}):
dic = {}
for meth in exposed:
- exec('''def %s(self, *args, **kwds):
+ exec('''def %s(self, /, *args, **kwds):
return self._callmethod(%r, args, kwds)''' % (meth, meth), dic)
ProxyType = type(name, (BaseProxy,), dic)
@@ -1017,7 +1014,7 @@ def AutoProxy(token, serializer, manager=None, authkey=None,
#
class Namespace(object):
- def __init__(self, **kwds):
+ def __init__(self, /, **kwds):
self.__dict__.update(kwds)
def __repr__(self):
items = list(self.__dict__.items())
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index 665ca067fa..b223d6aa72 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -154,7 +154,7 @@ class _PoolCache(dict):
notification is done by the use of a queue that is provided when
instantiating the cache.
"""
- def __init__(self, *args, notifier=None, **kwds):
+ def __init__(self, /, *args, notifier=None, **kwds):
self.notifier = notifier
super().__init__(*args, **kwds)