我已经尝试在Python 2.6中执行此操作,它确实"有效":
>>> def f(i='I'): return i ... >>> f.func_defaults = (10,) >>> f() 10
但这是官方指定的行为,还是我遇到了特定于实现的行为?
python
python ×1