How to Avoid the Assignment Statement (2010)
I disagree with the premise of this article. Sometimes using a mutable variable really is the simplest way to implement something:<p><pre><code>  def min(foo: List[int]) -&gt; Optional[int]:
    min = None
    for val in foo:
      if min is None or val &lt; min:
        min = val
    return min
</code></pre>
I argue this is much easier to read than the recursive version without assignments:<p><pre><code>  def min(foo: List[int]) -&gt; Optional[int]:
    if not foo:
      return None
    else if len(foo) == 1:
      return foo[0]
    else:
      rest_min = min(foo[1:])
      return rest_min if rest_min &lt; foo[0] else foo[0]
</code></pre>
We&#x27;re optimizing for readability, and sometimes readability means mutable variables. This is to says nothing about performance which is often much better with mutable variables in languages like C++.<p>Edit: people have posted better version of my code in the comments. Take a look for more pythonic examples.