Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created September 2, 2026 20:15
Show Gist options
  • Select an option

  • Save mypy-play/d1dc20f1e30724cb070f327e6a882076 to your computer and use it in GitHub Desktop.

Select an option

Save mypy-play/d1dc20f1e30724cb070f327e6a882076 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
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