What’s the difference between enum and namedtuple?
As an analogy (albeit an imperfect one), you can think of enum.Enum and namedtuple in python as enum and struct in C. In other words, enums are a way of aliasing values, while namedtuple is a way of encapsulating data by name. The two are not really interchangeable, and you can use enums as the …