On Fri, Apr 12, 2013 at 9:34 AM, Guido van Rossum <gu...@python.org> wrote: > To me, NotImplementedError means that a subclass didn't implement > something it should have implemented. But that's not the case here, is > it? It's not a bug in the class, it's a bug in the call site. So I > agree it ought to be TypeError.
Seems I was late to this particular argument. :-) Anyway, as far as I can tell the PEP looks great. I personally think it would be nicer if regular Enums were ordered (as long as the underlying values are ordered), but I don't care enough to overrule the FLUFL. I do wonder about this passage in the PEP: > Let's say you wanted to encode an enumeration value in a database. You might > want to get the enumeration class object from an enumeration value:: > > >>> cls = Colors.red.enum > >>> print(cls.__name__) > Colors I don't understand what this has to do with storing enums in a database. But it reminded me that for the purpose of storing enums in a database, it would be nice to have two examples: one that stores the names and looks them up (do you really have to use getattr() for that?), and one that stores the values and looks them up (how do you do that at all?). Should the metaclass-based API used to create IntEnum be documented, so strongly motivated people can write their own crazy variants? -- --Guido van Rossum (python.org/~guido) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com