hyanwong / giglib

MIT License
4 stars 2 forks source link

IntFlags in constants.py changes behaviour under python 3.11 (vs 3.10) #109

Closed hyanwong closed 5 months ago

hyanwong commented 6 months ago

In constants.py we declare the equivalent of the following:

class Const(IntFlag):
    NODE_IS_SAMPLE = 1

Then when we use the bitwise inversion operator we get different results in python 3.10 vs 3.11

~Const.NODE_IS_SAMPLE == -2  # True in python 3.10
~Const.NODE_IS_SAMPLE == 2  # True in python 3.11

We should work out what the correct thing to do here is.

hyanwong commented 5 months ago

Removed the IntFlag subclassing from the basic constants, as it doesn't make sense e.g. for NULL.