Polls for currently pending events.

    Returns:
        Iterable[Event]: Events from the event queue.

def poll():
    """Polls for currently pending events.

    Returns:
        Iterable[Event]: Events from the event queue.
    """
    event_ptr = ffi.new('SDL_Event *')
    while lib.SDL_PollEvent(event_ptr):
        yield Event._from_ptr(event_ptr)
        event_ptr = ffi.new('SDL_Event *')