bra*_*ray 9 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
Sve*_*ach 11
该函数inspect.getargspec()在Python 2中完成了您所需的功能.
inspect.getargspec()
在Python 3中,这已被弃用,您应该使用它signature.
signature
归档时间:
15 年,3 月 前
查看次数:
1126 次
最近记录:
9 年,9 月 前