如何在Python 3中获取可变默认参数元组?
def foo(x=[]):
pass
失败的尝试:
foo.func_defaults
错误:
AttributeError: 'function' object has no attribute 'func_defaults'
如何在Python 3中获取可变默认参数元组?
def foo(x=[]):
pass
失败的尝试:
foo.func_defaults
错误:
AttributeError: 'function' object has no attribute 'func_defaults'