Changes between Initial Version and Version 1 of Ticket #16743, comment 16


Ignore:
Timestamp:
09/24/14 14:05:46 (5 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16743, comment 16

    initial v1  
    1212> return cmp(I.norm(), J.norm()) or cmp(I.pari_hnf().sage(), J.pari_hnf().sage())
    1313> }}}
    14 Better yet: define a sorting ''key'' instead of a comparison function, this is the only(!) way in Python 3 and already works now. Your key would then be the tuple `(norm,hnf)`.
     14Better yet: define a sorting ''key'' instead of a comparison function, this is the only(!) way in Python 3 and already works now. Your key would then be the tuple `(norm,hnf)`. See [http://python3porting.com/preparing.html#when-sorting-use-key-instead-of-cmp]