creating an artificial "last element" in sort list

Paul Rubin no.email at nospam.invalid
Fri Sep 28 21:42:27 EDT 2012


dave <davidreynon at gmail.com> writes:
> What does x need to be to always be last on an ascending sort no
> matter what 'a' and 'b' are.... within reason... 

Why are you trying to do that?  It sounds ugly.  Just sort the list with
the a's and b's.  If you absolutely have to, you could make a class with
comparison methods that put all the x's at the bottom, but look for
something cleaner.



More information about the Python-list mailing list