[issue18042] Provide enum.unique class decorator

Nick Coghlan report at bugs.python.org
Fri May 24 04:53:23 CEST 2013


Nick Coghlan added the comment:

You don't generally see reversals of decisions where Guido has made an explicit choice based on consistency with the rest of the language. The fact that aliases are permitted in enumerations by default is consistent with the normal behaviour of namespaces and dictionaries in general, so providing a way to opt in to the stricter checks is a better solution.

The idea of passing flags or other configuration options to the metaclass is also rather ugly. Offering permissive behaviour by default with an easy way to opt in to additional restrictions is far more in keeping with the general "consenting adults" ethos of the language.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18042>
_______________________________________


More information about the Python-bugs-list mailing list