Skip to content

Commit a908a24

Browse files
author
Daniel Wagenknecht
committed
step: remove step parameter from decorated functions signature
The step parameter that some functions decorated with @step take is for internal use only and passing it as an argument when calling the wrapped function has no effect. For the inspect tooling to report the correct signature for the wrapped function we need to remove the parameter from the list. Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com>
1 parent ef0f630 commit a908a24

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

labgrid/step.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ def wrapper(*_args, **_kwargs):
227227
step.stop()
228228
return _result
229229

230+
wrapper.__signature__ = signature.replace(
231+
parameters=[p for p in signature.parameters.values() if p.name != "step"]
232+
)
230233
return wrapper
231234

232235
return decorator

0 commit comments

Comments
 (0)