On Mon, 3 Apr 2023 at 08:28, Greg Ewing <[email protected]> wrote: > > On 2/04/23 6:36 pm, Benedict Verhegghe wrote: > > 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? > > But Enum itself isn't an enum, it's a constructor for enums. > I think len() just happens to work on it as a side effect > of the way enums are implemented. >
Enum itself is iterable, so the question is: how important is it to block this? Is it actually a problem that the Enum type acts like it has no elements? ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/3MYSADUPEVP5DJKMRMFF6JKYQAWKAWXK/ Code of Conduct: http://python.org/psf/codeofconduct/
