(cls, value)
| 32 | |
| 33 | @classmethod |
| 34 | def _check_value(cls, value): |
| 35 | max = cls._maximum() |
| 36 | if not isinstance(value, int): |
| 37 | raise TypeError |
| 38 | if value < 0 or value > max: |
| 39 | name = cls._short_name() |
| 40 | raise ValueError(f"{name} must be an int between >= 0 and <= {max}") |
| 41 | |
| 42 | @classmethod |
| 43 | def from_text(cls: Type[TIntEnum], text: str) -> TIntEnum: |