[Python-ideas] IntFlags

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 5 21:30:39 CET 2015


Concerning ~, if you think of it as a set, then ~x should
be the result of exlusive-oring x with an int containing
all the valid bits, i.e. the value obtained by oring all
the defined values together.

This is different from what you would get in C, but it's
self-consistent and the repr() would make sense.

-- 
Greg


More information about the Python-ideas mailing list