def components(pattern):
    """Return the op, x, and y arguments; x and y are None if missing."""
    x = pattern[1] if len(pattern) > 1 else None
    y = pattern[2] if len(pattern) > 2 else None
    return pattern[0], x, y