mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)
This commit is contained in:
parent
4a686504eb
commit
2085bd0877
34 changed files with 126 additions and 261 deletions
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue