Last active
May 9, 2020 01:15
-
-
Save cosinekitty/c5392c63974566eb78204339265b6250 to your computer and use it in GitHub Desktop.
Different enumerated types can have same values, but still be distinct.
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, unique | |
| @unique | |
| class Suit(Enum): | |
| Club = 1 | |
| Diamond = 2 | |
| Heart = 3 | |
| Spade = 4 | |
| @unique | |
| class Animal(Enum): | |
| Dog = 1 | |
| Cat = 2 | |
| Llama = 3 | |
| Octopus = 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment