Steven Bethard wrote:
So I've been playing around with trying to add a keyword argument to min and max that works similarly to the one for sorted. It wasn't too hard actually, but it does raise a few questions about proper handling of keyword arguments.

Sorry to reply to my own post, but I thought of another question about adding this feature. Should the following work?


.>>> max((2, 'a'), (1, 'b'), key=operator.itemgetter(1))

That is, should you be able to specify a 'key' argument as a keyword parameter after a list of positional arguments (to be min/maxed).

Steve
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to