In JavaScript we can do this:
var Color = {
YELLOW: { value: 1, displayString: "Yellow" },
GREEN: { value: 2, displayString: "Green" },
}
So I can call:
Color.YELLOW.displayString
In Java we can do this:
public enum Color {
YELLOW (1, "Yellow"),
GREEN (2, "Green"),
private Color(String value, int displayString){
this.value = value;
this.displayString = displayString;
}
private final int value;
private final String displayString;
public String getValue() {return value;}
public String getDisplayString() {return displayString;}
}
So I can call:
Color.YELLOW.getDisplayString()
After much research I haven't found a clean way to do this in Python using the built-in Enum module. How can I do this?
Thanks