def py_xor_simple(str1, str2):
 warnings.warn('deprecated', DeprecationWarning)
 precondition((len(str1) == len(str2)), 'str1 and str2 are required to be of the same length.', str1=str1, str2=str2)
 return ''.join(map(chr, map(operator.__xor__, map(ord, str1), map(ord, str2))))

def py_xor_simple ( str1 , str2 ) : warnings . warn ( 'deprecated' , DeprecationWarning ) precondition ( ( len ( str1 ) == len ( str2 ) ) , 'str1 and str2 are required to be of the same length.' , str1 = str1 , str2 = str2 ) return '' . join ( map ( chr , map ( operator . __xor__ , map ( ord , str1 ) , map ( ord , str2 ) ) ) )
benchmarks show that this is the same speed as py_xor() for small strings and much slower for large strings .