On Sat, Jan 3, 2009 at 05:15, Kent Johnson <[email protected]> wrote: > On Fri, Jan 2, 2009 at 6:12 PM, Sander Sweers <[email protected]> wrote: >> not understand how operator.itemgetter(1) works. > > See > http://personalpages.tds.net/~kent37/kk/00007.html#e7the-operator-module
Ok, if I understand this correctly counts.iteritems() creates a tuple (name, count) and this is passed to operator.itemgetter() which take the second value to sort the list. Previously I used a function with cmp to sort datetime.date objects but this works way better :-) Thanks Sander _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
