def is_in(val, lvals):
    """ Replace the standard 'in' operator but uses 'is' to check membership.

    This method is mandatory if element to check overloads operator '=='.

    Args:
        val:   Value to check
        lvals: List of candidate values
    Returns:
        True if value is in the list of values (presence checked with 'is')
    """
    return any(val is v for v in lvals)