from enum import IntEnum
from typing import List
class EnumClass(IntEnum):
A = 1
B = 2
@staticmethod
def listofconditions() -> 'List[EnumClass]':
return [EnumClass.A.numerator, \
EnumClass.B.numerator]
if 1 in EnumClass.listofconditions:
pass
yields:
[pylint]:E1135 Value 'EnumClass.listofconditions' doesn't support membership test
(I posted this for others Googling a solution to this cryptic message in order to makes sense of it. Solution to follow)
Change code to:
if 1 in EnumClass.listofconditions():