Steve Holden <[EMAIL PROTECTED]> wrote:

> Only half the number, of course. The advantage of the key function is
> that each element requires only one call out to a Python function, and
> the comparisons then take place using a C-coded comparison function.

You don't need any Python-coded function at all.  The operator
module is your friend: key=operator.attrgetter('real', 'imag')
will create the required tuples for sorting.


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
"God is real, but Jesus is an integer."      !  bellman @ lysator.liu.se
                                             !  Make Love -- Nicht Wahr!
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to