Suppose I have a Flag enum like this:
From enum import Flag
class suspicion(Flag):
TOT_PCNT_LOW = 1
IND_PCNT_LOW = 2
IND_SCORE_LOW = 4
And suppose I have an integer that was constructed using these flags
i = suspicion.IND_PCNT_LOW.value | suspicion.TOT_PCNT_LOW.value # i == 3
How do I get a list of the names of the flags that are set in the integer? For example:
print(some_method(i)) # prints ["IND_PCNT_LOW", "TOT_PCNT_LOW"]