I ran across the caret operator in python today and trying it out, I got the following output:
>>> 8^3 11 >>> 8^4 12 >>> 8^1 9 >
It's a bit-by-bit exclusive-or. Binary bitwise operators are documented in chapter 5 of the Python Language Reference.