[Python-3000] What about operator.*slice?

Facundo Batista facundobatista at gmail.com
Tue Sep 4 23:46:43 CEST 2007


2007/9/4, Greg Ewing <greg.ewing at canterbury.ac.nz>:

> I think its main use is as a source of functions for passing
> to map(). Unless I'm mistaken, that's still going to be faster

Or to sort:

>>> import operator
>>> l = [(1, 3), (2, 2)]
>>> sorted(l, key=operator.itemgetter(1))
[(2, 2), (1, 3)]
>>>

Regards,

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/


More information about the Python-3000 mailing list