title: implementing argmax in Python
body: <p>How should argmax be implemented in Python?  It should be as efficient as possible, so it should work with iterables.</p>
  
  <p>Three ways it could be implemented:</p>
  
  <ul>
  <li>given an iterable of pairs return the key corresponding to the greatest value</li>
  <li>given an iterable of values return the index of the greatest value</li>
  <li>given an iterable of keys and a function <code>f</code>, return the key with largest <code>f(key)</code></li>
  </ul>