title: What is the pythonic way to avoid default parameters that are empty lists?
body: <p>Sometimes it seems natural to have a default parameter which is an empty list. Yet <a href="https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument">Python produces unexpected behavior in these situations</a>.</p>
  <p>If for example, I have a function:</p>
  <pre><code>def my_func(working_list=[]):
      working_list.append(&quot;a&quot;)
      print(working_list)
  </code></pre>
  <p>The first time it is called, the default will work, but calls after that will update the existing list (with one <code>&quot;a&quot;</code> each call) and print the updated version.</p>
  <p>So, what is the Pythonic way to get the behavior I desire (a fresh list on each call)?</p>