[nem-en] strange warning when compiling

Philippe Quesnel philippe.quesnel at gmail.com
Tue Jan 10 17:40:43 CET 2006


ok, thank you,

just a thought:
it looked to me that the 'special thing' about %xx ops was that they
return True / False instead of the actual bitwise op result.

Why is this specific to enums ?
(bit operations tend be often done with ints, right ?)



On 1/10/06, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> %^^ is supposed to be used on enum types, because enums are not
> implicitly converted to int, so to use ^ operator on them it is
> necessary to cast :> them to ints. When you want to do ^ just for
> ints, then no casts are necessary.
> Compiler message is correct, though maybe a little bit misterious.
> Also maybe in quick guide it should be stated that %XX operators are
> used for enums.



More information about the devel-en mailing list