Hmm... An idea: if a,b==c,d:

Erik Max Francis max at alcyone.com
Mon Nov 18 18:30:02 EST 2002


Richard Dillingham wrote:

> > Instead, (a, b) >= (c, d) is defined as (a>c or (a==c and b>=d)).
> 
> I just keep reading that again and again and thinking "WTF? Why?
> Wha...."

When written out like that it looks scary, but in fact it's quite
straightforward (and is an obvious definition).  Anyone familiar with
mathematics knows that defining order relations on aggregate objects
like vectors or even complex numbers is problematic.  So if you need an
ordering, it makes sense to compare the first elements, then if those
match, look to the second, and if those match, look to the third, etc.
stopping when you run out of one or the other or you find an element
pair that doesn't match.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Who's not sat tense before his own heart's curtain?
\__/ Rainer Maria Rilke
    Maths reference / http://www.alcyone.com/max/reference/maths/
 A mathematics reference.



More information about the Python-list mailing list