Created
September 2, 2026 20:15
-
-
Save mypy-play/d1dc20f1e30724cb070f327e6a882076 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from enum import Enum | |
| from typing import reveal_type | |
| class NoValue(Enum): | |
| FIRST = "first" | |
| def command(self) -> str: | |
| reveal_type(self.value) | |
| return "--" + self.value | |
| class WithValue(Enum): | |
| _value_: str | |
| FIRST = "first" | |
| def command(self) -> str: | |
| reveal_type(self.value) | |
| return "--" + self.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment