Created
November 15, 2022 09:04
-
-
Save zupo/1f8671798cfc85fb7350d327fc7fa502 to your computer and use it in GitHub Desktop.
This file contains 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
# 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