If an Enum class explicitly declares the type of the _value_ attribute, pyright should honor it and enforce type consistency.
from enum import Enum
class Color(Enum):
_value_: int
RED = 1 # OK
GREEN = "green" # Should be type error
class Planet(Enum):
_value_: str
def __init__(self, value: int, mass: float, radius: float):
self._value_ = value # Shoudl be type error
MERCURY = (1, 3.303e+23, 2.4397e6)