diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-06-01 08:00:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-01 08:00:15 (GMT) |
commit | 2085bd0877e17ad4d98a4586d5eabb6faecbb190 (patch) | |
tree | c25b20d33ebf4d64a28abb8591f4ff7acf90614c /Lib/multiprocessing | |
parent | 4a686504eb2bbf69adf78077458508a7ba131667 (diff) | |
download | cpython-2085bd0877e17ad4d98a4586d5eabb6faecbb190.zip cpython-2085bd0877e17ad4d98a4586d5eabb6faecbb190.tar.gz cpython-2085bd0877e17ad4d98a4586d5eabb6faecbb190.tar.bz2 |
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/dummy/__init__.py | 2 | ||||
-rw-r--r-- | Lib/multiprocessing/managers.py | 11 | ||||
-rw-r--r-- | Lib/multiprocessing/pool.py | 2 |
3 files changed, 6 insertions, 9 deletions
diff --git a/Lib/multiprocessing/dummy/__init__.py b/Lib/multiprocessing/dummy/__init__.py index 403f5e5..6a14686 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 5141522..7e1818b 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 665ca06..b223d6a 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) |