Skip to content

Commit 129a4d1

Browse files
committed
Sync SPEC 7 with scipy
ref: scipy/scipy#23276
1 parent 7fe6758 commit 129a4d1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec-0007/transition_to_rng.py

Lines changed: 12 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,17 @@ 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(
167+
parameters=[
168+
*wrapped_signature.parameters.values(),
169+
inspect.Parameter(
170+
old_name, inspect.Parameter.KEYWORD_ONLY, default=None
171+
),
172+
]
173+
)
174+
163175
return wrapper
164176

165177
return decorator

0 commit comments

Comments
 (0)