[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] BUG? rect __eq__



On Tue, 2006-06-06 at 22:12 +1000, Rene Dudfield wrote:
> Hi,
> 
> thanks for the notes.
> 
> 
> Yes I agree the current behaviour is more useful, and probably more expected.
> 
> Note that all of these are true:
> Rect(0,0,10,10) == [0,0,10,10]
> [0,0,10,10] == [0,0,10,10]
> Rect(0,0,10,10) == (0,0,10,10)
> 
> However:
> (0,0,10,10) != [0,0,10,10]

This would be news to me. Tuples and lists with the same elements are
equal in Python.

id(a) == id(b) is the wrong way to write it. Use "a is b".
-- 
Joe Wreschnig <piman@xxxxxxxxxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part