[Python-Dev] enum discussion: can someone please summarize open issues?

Glenn Linderman 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:
>
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130428/e189ab71/attachment.html>


More information about the Python-Dev mailing list