[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pygame] Rect's relational operators
Hi,
I've been playing with Rect's relational operators. It seems, that they
have some flaws:
Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import pygame
>>> from pygame.locals import *
>>> pygame.version.ver
'1.2'
>>> a = Rect(0, 0, 0, 0)
>>> b = Rect(0, 0, 20, 20)
>>> a == b
1
>>> a = Rect(1, 1, 0, 0)
>>> b = Rect(0, 0, 20, 20)
>>> a == b
0
>>> a = Rect(0, 0, 1, 1)
>>> b = Rect(0, 0, 2, 2)
>>> a > b
0
>>> a < b
0
>>> a = Rect(1, 1, 1, 1)
>>> b = Rect(0, 0, 3, 3)
>>> a > b
1
>>> a < b
0
Relational operators are not mentioned in the documentation, so I guess
they are not supported. But at least equality operator should work correctly.
Ludek Smid
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org