[Python-Dev] enum discussion: can someone please summarize open issues?
v+python at g.nevcal.com
Mon Apr 29 02:07:32 CEST 2013
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:
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev