what are python closures good for? : <p>I understand the technical definition of python closures: let's make it concrete.</p>

<pre><code>def foo(x):
    def bar(y):
        print(x+y)
    return bar
</code></pre>

<p>In this example <code>x</code> will get bound with <code>bar</code>. But what are these things actually good for? ie in the toy example above one could have just as easily written</p>

<pre><code>def bar(x,y):
    print(x+y)
</code></pre>

<p>I would like to know the best use cases for using closures instead of, for example, adding extra arguments to a function.</p>
