Python mutable default argument: Why?
<p>I know that default arguments are created at the function initialisation time and not every time the function is called.  See the following code:</p>

<pre><code>def ook (item, lst=[]):
    lst.append(item)
    print 'ook', lst

def eek (item, lst=None):
    if lst is None: lst = []
    lst.append(item)
    print 'eek', lst

max = 3
for x in xrange(max):
    ook(x)

for x in xrange(max):
    eek(x)
</code></pre>

<p>What I do not get is why this was implemented this way.  What benefits does this behaviour offers over an initialisation at each call time?</p>
