
April 4, 2023
6:47 a.m.
Yes, that is correct. Any subclass of Enum will also be a type, and will have a length.
That is the correct and expected behavior, as described on https://docs.python.org/3/library/enum.html
Yeah, and I'm of the opinion that it's not a problem for Enum to have zero possible values, but to have the concept of values.
I encountered that Enum having a len hid a mistake on my part. If len(Enum) raised, my mistake would be immediately apparent, however at the end of the day, my mistake was easily found. I am using this issue to mostly try how to contribute to Python and I do not have strong opinion on this issue either way. IMHO len(Enum) should raise, but idk if it is worth potential downstream breakages.