This should be on r/learnpython
This is just reiterating in a convoluted way what the official documentation already states. In fact, it manages to answer the question in this post's title explicitly at the very beginning:
*They are most useful when you have a variable that can take one of a limited selection of values.*
Source: [https://docs.python.org/3/howto/enum.html](https://docs.python.org/3/howto/enum.html)
The world of tech blogs is over saturated with this kind of articles that really bring nothing new to the table and simply misdirect people from the primary sources of information.
I can't speak for every single article written about enums, but I disagree that this article brings nothing to the table.
It shows a clear, self-contained, simple, and **complete** example of the prime use case for enums.
The docs are great and I refer to them very often, but they're typically not structured in this way.
7 Comments
notyoyu@reddit
spidLL@reddit
spidLL@reddit
Adrewmc@reddit
notyoyu@reddit
RojerGS@reddit (OP)
RojerGS@reddit (OP)