3 ms·
Enums are implemented in a weird way in Python, not as part of the language but as a class that modifies itself. That said, this article is not what I expected
by mixmastamyk 6y ago
Enums are implemented in a weird way in Python, not as part of the language but as a class that modifies itself. That said, this article is not what I expected.
- comfydragon 6y agoThey're implemented using metaclasses. Metaprogramming is a part of the language.
- mixmastamyk 6y agoI know that, there's a lot of magic going on due to that choice of indirect implementation.