Skip to content

Commit 02bd475

Browse files
authored
Sync SPEC 7 with scipy
ref: scipy/scipy#23276
1 parent 7fe6758 commit 02bd475

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec-0007/transition_to_rng.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
import functools
3+
import inspect
34
import warnings
45

56

@@ -160,6 +161,13 @@ def wrapper(*args, **kwargs):
160161

161162
return fun(*args, **kwargs)
162163

164+
# Add the old parameter name to the function signature
165+
wrapped_signature = inspect.signature(fun)
166+
wrapper.__signature__ = wrapped_signature.replace(parameters=[
167+
*wrapped_signature.parameters.values(),
168+
inspect.Parameter(old_name, inspect.Parameter.KEYWORD_ONLY, default=None),
169+
])
170+
163171
return wrapper
164172

165173
return decorator

0 commit comments

Comments
 (0)