3 ms·
Python does have enums in its standard library https://docs.python.org/3/library/enum.html https://docs.python.org/3/library/enum.html
by ollien 3y ago
Python does have enums in its standard library
https://docs.python.org/3/library/enum.html https://docs.python.org/3/library/enum.html
- deleted 3y ago[deleted]
- BugsJustFindMe 3y agoHeh. 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.