On Mon, Jul 31, 2006 at 04:52:27PM -0400, Kris Schnee wrote: > > Wouldn't the line: > if event.type == pygame.KEYDOWN and event.key == > > pygame.KEY_ESCAPE: > > get interpreted as: > "If event.type == (pygame.KEYDOWN and event.key == > > pygame.KEY_ESCAPE):"? > > In other words, shouldn't you put those two conditions (in parentheses)?
No. == is evaluated first before "and". Even with no parenthesis, if x == y and foo == bar: is evaluated as: if (x == y) and (foo == bar): --- James Paige
