
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 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 meaningful result on len.
Thoughts? _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/TQB2HR... Code of Conduct: http://python.org/psf/codeofconduct/