title: A safe max() function for empty lists
body: <p>Evaluating,</p>
  
  <pre><code>max_val = max(a)
  </code></pre>
  
  <p>will cause the error,</p>
  
  <pre><code>ValueError: max() arg is an empty sequence
  </code></pre>
  
  <p>Is there a better way of safeguarding against this error other than a <code>try</code>, <code>except</code> catch?</p>
  
  <pre><code>a = []
  try:
      max_val = max(a)
  except ValueError:
      max_val = default 
  </code></pre>