Skip to content

Instantly share code, notes, and snippets.

@zupo
Created November 15, 2022 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zupo/1f8671798cfc85fb7350d327fc7fa502 to your computer and use it in GitHub Desktop.
Save zupo/1f8671798cfc85fb7350d327fc7fa502 to your computer and use it in GitHub Desktop.
# Python 3.10
from enum import Enum
class Direction(Enum):
up = "up"
down = "donw"
assert "up" == Direction.up.value
# Python 3.11
from enum import StrEnum, auto
class Direction(StrEnum):
up = auto()
down = auto()
assert "up" == Direction.up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment