From Color.RED, I would like to access FOO's value of 2. Is that possible?
class Color(Enum):
RED = BOO.FOO
BLUE = BOO.BAR
class Person(Enum):
FOO = 2
BAR = 3
Assuming that you wanted to use Person.FOO instead of BOO.FOO:
class Person(Enum):
FOO = 2
BAR = 3
class Color(Enum):
RED = Person.FOO.value
BLUE = Person.BAR.value
Note that just using Person.FOO will get the enumeration member and not its value. If you need the value, you will have to declare it as shown above.
If you just define RED = Person.FOO, to access the value you will have to use Color.RED.value.value.
BOO and Person don't match, but assuming you're wanting them to: you can access the raw value of an enum using .value and they chain together just fine.
from enum import Enum
class Boo(Enum):
FOO = 2
BAR = 3
class Color(Enum):
RED = Boo.FOO
BLUE = Boo.BAR
print(Color.RED.value.value) # prints 2