Python 通过内省查找位置参数的名称

Python 通过内省查找位置参数的名称,python,Python,有没有办法找出python函数的位置参数的名称 def foo(arg1, arg2): pass f=foo # How do I find out want the 1st argument to f is called? I want 'arg1' as an answer 该函数执行Python 2中所需的操作 在Python3中,这已被弃用,您应该改为使用

有没有办法找出python函数的位置参数的名称

def foo(arg1, arg2):
  pass

f=foo
# How do I find out want the 1st argument to f is called? I want 'arg1' as an answer
该函数执行Python 2中所需的操作

在Python3中,这已被弃用,您应该改为使用