Hacker News new | ask | show | jobs
by ollien 844 days ago
Python does have enums in its standard library

https://docs.python.org/3/library/enum.html

1 comments

Heh. Python's enums are not real types, they're just funny classes, so you still have to do dumb things like assign an internal value (commonly a dumb int) and were (and probably still are) wildly deficient in many other commonly-desired ways for a very long time. A bunch of things covered in this blog post (like StrEnum and EnumCheck) weren't added until pretty recently.