Are you allowed to modify func_defaults (__defaults__ in Python 3.x) in Python?

python

Solution

In the documentation `func_defaults` is documented as "writable", so it would seem to be defined behavior.

Problem

I've tried doing this in Python 2.6, and it does "work": ``` >>> def f(i='I'): return i ... >>> f.func_defaults = (10,) >>> f() 10 ``` But is this officially specified behavior, or am I hitting an implementation-specific behavior?

Original source