Is there a way to override the "key" function for list.max() and list.sort() in the class of the list items?
<p>I have multiple subclasses of a superclass that store something in a <code>instance_of_a_class.value</code> and I override <code>__cmp__()</code> to provide reasonable <code>==</code>, <code>&lt;</code>, <code>&gt;</code> etc. comparisons.</p>

<p>However, I have multiple places in my code where I do</p>

<p><code>min(list_of_instances_of_class, key=lambda _: _.value)</code> or <code>max(list_of_instances_of_class, key=lambda _: _.value)</code> and an occasional <code>sorted(...</code></p>

<p>Is there a function to override in the class so that I don't have to specify the <code>key</code> function for each call to the said functions or do I need to subclass <code>list</code> and override the <code>max</code>, <code>min</code> and <code>sorted</code> methods?</p>
