Use inspect.signature instead of the deprecated getargspec
It's removed in Python 3.11 so QMTTest.py
will stop working when using that version.
Output comparison, python 2:
from inspect import getargspec
def my_function(arg1, arg2, arg3=None, *args, **kwargs):
pass
argspec = getargspec(my_function)
print(argspec) # ['arg1', 'arg2', 'arg3']
Python 3:
import inspect
def my_function(arg1, arg2, arg3=None, *args, **kwargs):
pass
args_order = [param.name for param in inspect.signature(my_function).parameters.values()
if param.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD]
print(args_order) # ['arg1', 'arg2', 'arg3']
Edited by Juan Miguel Carceller
Merge request reports
Activity
Filter activity
added 5 commits
-
f165b634...f2781c31 - 3 commits from branch
gaudi:master
- 02032ce3 - Use inspect.signature
- 3d5226f9 - Fix pre-commit
-
f165b634...f2781c31 - 3 commits from branch
changed milestone to %v37r0
added lhcb-gaudi-head label
assigned to @clemenci
- [2023-09-12 00:03] Validation started with lhcb-gaudi-head#3680
- [2023-09-12 00:20] Validation started with lhcb-run2-gaudi-head#610
- [2023-09-12 00:26] Validation started with lhcb-sim10-gaudi-head#377
- [2023-09-12 07:25] Validation started with lhcb-gaudi-head#3681
Edited by Software for LHCbmentioned in commit ae23043d
Please register or sign in to reply