[Python-ideas] len(Enum) should raise TypeError

2023-04-01 Thread Richard Hajek
# Feature or enhancement `len(Enum)` has no useful meaning and should therefore raise the appropriate error # Pitch I cannot figure out any scenario, in which len(Enum) should not raise. Enum is a type and as any other types, such as `len(list)` or `len(dict)`, and should not give any meaning

[Python-ideas] Re: len(Enum) should raise TypeError

2023-04-01 Thread Benedict Verhegghe
An Enum is functionally a container with a limited set of constants. Why should it not be legitimate to ask for the number of constants in it? Op 1/04/2023 om 16:45 schreef Richard Hajek: # Feature or enhancement `len(Enum)` has no useful meaning and should therefore raise the appropriate er