Closed as not planned
Description
Currently the following code doesn't specialise:
from enum import Enum
class Color(Enum):
RED = 1
GREEN = 2
BLUE = 3
def f():
for _ in range(10):
Color.RED
f()
This use pattern is very common in enums and also the recommended way to check constants in pattern matching. Specialising for this all mutable class attributes should speed up those use cases.