I have his Enum :
class MultiAttr(Enum):
RED = (1, 10)
GREEN = (2, 20)
BLUE = (3, 20)
def __init__(self, id, val):
self.id = id
self.val = val
assert MultiAttr((2, 20)) == MultiAttr.GREEN
Assertion passes.
- Why Pylance in VSCode complains
Argument missing for parameter "val"
? - As the first attribute is the identifer, is there a way to achieve :
MultiAttr(2) == MultiAttr.GREEN
?