(tokens, local_dict, global_dict)
return result
Treats XOR, ``^``, as exponentiation, ``**``.
Treats XOR, ``^``, as exponentiation, ``**``.
Treats XOR ^ as exponentiation ** .
def convert_xor(tokens, local_dict, global_dict):
    """Treats XOR, ``^``, as exponentiation, ``**``."""
    result = []
    for toknum, tokval in tokens:
        if toknum == OP:
            if tokval == '^':
                result.append((OP, '**'))
            else:
                result.append((toknum, tokval))
        else:
            result.append((toknum, tokval))

    return result
def convert_xor ( tokens , local_dict , global_dict ) : result = [ ] for toknum , tokval in tokens : if toknum == OP : if tokval == '^' : result . append ( ( OP , '**' ) ) else : result . append ( ( toknum , tokval ) ) else : result . append ( ( toknum , tokval ) ) return result