import select


def is_ready(fileno, timeout=0):
    """Check if there is data to read from fileno."""
    p = select.poll()
    p.register(fileno, select.POLLIN)
    events = p.poll(timeout)
    return len(events) != 0