7 ms·
Part of the reason why Enums weren’t originally added to the stdlib was because if you get ten developers in a room there will be eleven conflicting expectation
by stevenjohns 6y ago
Part of the reason why Enums weren’t originally added to the stdlib was because if you get ten developers in a room there will be eleven conflicting expectations from an Enum class.
Personally I’ve never needed to use the Enum class, ever, in the last five years of Python development. It takes barely any time to implement a custom replacement if you need one, but for 99% of my use cases a dictionary or tuple has been enough.
- zaphirplane 6y agoThese lite Enums are syntactic sugar over a bunch of constant strings and those strings inserted in a list So yes you can always use something else just like all the fold/zip/map can be replaced with also something else ;)