On 4/28/2013 4:37 PM, Steven D'Aprano
wrote:
I
have also suggested that that the enum package provide a decorator
which can be used to explicitly flag values to *not* be turned into
enum values. See here:
http://mail.python.org/pipermail/python-dev/2013-April/125641.html
Even if the Enum class doesn't support this feature, I ask that it
be
written in such a way that a subclass could add it (i.e. please
expose
a public method for deciding what to exclude).
That last comment is very interesting to me... I think it would be
good if the enum implementation doesn't prevent the creation of a
subclass of integer enumerations which can be extended so that when
arithmetic is done on them, that new enumeration values and names
can be added to the collection (think flag fields). The add ones
might have names that do not follow the rules for identifiers.