Bitwise not (~
) is well-defined in languages that define a specific bit length and format for ints. Since in Python 3, ints can be any length, they by definition have variable number of bits. Internally, I believe Python uses at least 28 bytes to store an int, but of course these aren't what bitwise not is defined on.
How does Python define bitwise not:
- Is the bit length a function of the int size, the native platform, or something else?
- Does Python sign extend, zero extend, or do something else?