News for hackers. Stuff that matters.
Re:Using Enumerated Types in Python by NicoJuicy on Saturday June 06, 2020 @05:42PM (#23442467)
Recently I started to use enumeration classes instead of enums ( where it fits)

https://docs.microsoft.com/en-us/dotnet/architecture/microse...

If you develop in c#, I would definitely recommend trying it out

A better example can be found here actually: https://lostechies.com/jimmybogard/2008/08/12/enumeration-cl...

Re:Using Enumerated Types in Python by nerdponx on Saturday June 06, 2020 @05:46PM (#23442506)
What's the basic idea here? That instead of ints or strings, your enum values themselves are instances of custom classes with whatever behavior you want?
Re:Using Enumerated Types in Python by NicoJuicy on Saturday June 06, 2020 @06:19PM (#23442778)
If I would describe the use-case:

If you use switches with enums for functionality, this is a better way ( personal opinion). Since Enums quickly need more than 1 switch and this could wrap that behaviour

Your description is also pretty good