Slightly more elegant:

    if base not in BASE_PAIRING: