[Python-Dev] Enum: subclassing?

Eli Bendersky eliben at gmail.com
Thu May 2 17:58:07 CEST 2013


On Thu, May 2, 2013 at 8:54 AM, Barry Warsaw <barry at python.org> wrote:

> On May 01, 2013, at 03:11 PM, Ethan Furman wrote:
>
> >The reason __int__ is there is because pure Enums should be using plain
> ints
> >as their value 95% or more of the time, and being able to easily convert
> to a
> >real int for either database storage, wire transmission, or C functions
> is a
> >Good Thing.
>
> But then, Foo.a.value is good enough.
>

__int__ is out of Enum, Barry. You're preaching to the choir now ;-)

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130502/b0e9b213/attachment.html>


More information about the Python-Dev mailing list