finding max in python as per some custom criterion
<p>I can do max(s) to find the max of a sequence. But suppose I want to compute max according to my own function , something like so -</p>

<pre><code>currmax = 0
def mymax(s) :
  for i in s :
    #assume arity() attribute is present
    currmax = i.arity() if i.arity() &gt; currmax else currmax
</code></pre>

<p>Is there a clean pythonic way of doing this?</p>

<p>Thanks!</p>
