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

Cliff Wells LogiplexSoftware at earthlink.net
Mon Nov 18 18:27:51 EST 2002


On Mon, 2002-11-18 at 14:58, 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...."
> 
> *shudders*
> 
> Now I'm sorry I asked...

Just in case it isn't clear, it isn't defined that way /in the
interpreter/.  Andrew was merely stating that the two statements are
/equivalent/ in this particular example (otherwise, think of the mess
when there are more than two elements in the tuple).

Instead of thinking of a tuple as a coordinate, think of it as an
immutable list (which is basically what it is).  Then the comparison
makes more sense.  It's the same comparison used on other Python
sequences (lists, tuples, strings, etc).


-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/python-list/attachments/20021118/7ae70137/attachment.sig>


More information about the Python-list mailing list