| 1 | initial version |
Sage's preparser (*) turns ^ into the exponentiation symbol (**), in order to follow standard math notations:
sage: preparse("a=(a << 8) ^ (L[i])")
'a=(a << Integer(8)) ** (L[i])'
To enforce the original (Python) xor behavior, use ^^ instead of ^:
for i in range(3):
a=(a << 8) ^^ (L[i])
(*) see the answer to this question.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.