diff options
Diffstat (limited to 'tests/run/kwargs_passthrough.pyx')
-rw-r--r-- | tests/run/kwargs_passthrough.pyx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/run/kwargs_passthrough.pyx b/tests/run/kwargs_passthrough.pyx index 576306efd..c09b6cba4 100644 --- a/tests/run/kwargs_passthrough.pyx +++ b/tests/run/kwargs_passthrough.pyx @@ -138,6 +138,18 @@ def wrap_modify_mix(f): >>> wrapped(a=2, test=3) CALLED (2, 1) + + >>> def py_modify(**kwargs): + ... print(sorted(kwargs.items())) + ... kwargs['new'] = len(kwargs) + ... return kwargs + + >>> wrapped_modify = wrap_modify_mix(py_modify) + >>> sorted(wrapped_modify(a=1).items()) + CALLED + [('a', 1)] + [('a', 1), ('test', 1)] + [('a', 1), ('new', 2), ('test', 1)] """ def wrapper(*args, **kwargs): print("CALLED") |