# HG changeset patch # User Neil Muller # Date 1336402398 -7200 # Node ID d35a3762edda15452d199642cf465c665d9f1121 # Parent 2bdac178ec6fa0fa694691b27257dbd77f9faec2 Idiomatic diff -r 2bdac178ec6f -r d35a3762edda gamelib/main.py --- a/gamelib/main.py Mon May 07 16:51:52 2012 +0200 +++ b/gamelib/main.py Mon May 07 16:53:18 2012 +0200 @@ -92,11 +92,11 @@ if MOUSE_DOWN: if event.type == MOUSEBUTTONUP: MOUSE_DOWN = False - WINDOW_STACK[len(WINDOW_STACK) - 1].on_mouse_up(event.pos) + WINDOW_STACK[-1].on_mouse_up(event.pos) elif event.type == MOUSEMOTION: - WINDOW_STACK[len(WINDOW_STACK) - 1].on_mouse_move(event.pos) + WINDOW_STACK[-1].on_mouse_move(event.pos) elif not MOUSE_DOWN and event.type == MOUSEBUTTONDOWN: MOUSE_DOWN = True - WINDOW_STACK[len(WINDOW_STACK) - 1].on_mouse_down(event.pos) + WINDOW_STACK[-1].on_mouse_down(event.pos) elif event.type == QUIT: GAME_IS_RUNNING = False