title: Are there caveats of using mutable types as default parameters in functions in Python?
body: <p>I have recently read about mutable default parameters in Python.
  For some reason, I came up with an idea of using it like this:</p>
  <pre><code>data = [3, 4, 1, 8, 5, 9, 2, 6, 7]
  
  
  def get_min(checked=[]):
      global data
  
      mn = min((x for x in data if x not in checked))
      checked.append(mn)
  
      return mn
  </code></pre>
  <p>The code is pretty useless, and it can easily be replaced by a generator, but I am wondering if I should ever use such a technique in my projects. Are there any hidden caveats of doing such a thing?</p>
  <p>I have read some similar questions, but all I see are constant arguments about how this thing is a design flaw. So I want to get a clear answer: should I use it, or shouldn't I, and why?</p>