mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +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
|
@ -377,8 +377,7 @@ class _BaseExitStack:
|
|||
return MethodType(cm_exit, cm)
|
||||
|
||||
@staticmethod
|
||||
def _create_cb_wrapper(*args, **kwds):
|
||||
callback, *args = args
|
||||
def _create_cb_wrapper(callback, /, *args, **kwds):
|
||||
def _exit_wrapper(exc_type, exc, tb):
|
||||
callback(*args, **kwds)
|
||||
return _exit_wrapper
|
||||
|
@ -553,8 +552,7 @@ class AsyncExitStack(_BaseExitStack, AbstractAsyncContextManager):
|
|||
return MethodType(cm_exit, cm)
|
||||
|
||||
@staticmethod
|
||||
def _create_async_cb_wrapper(*args, **kwds):
|
||||
callback, *args = args
|
||||
def _create_async_cb_wrapper(callback, /, *args, **kwds):
|
||||
async def _exit_wrapper(exc_type, exc, tb):
|
||||
await callback(*args, **kwds)
|
||||
return _exit_wrapper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue