[Python-ideas] PEP for enum library type?
Brett Cannon
brett at python.org
Wed Feb 13 18:09:19 CET 2013
On Wed, Feb 13, 2013 at 11:38 AM, Antoine Pitrou <solipsis at pitrou.net>wrote:
> Le Wed, 13 Feb 2013 14:07:48 +1000,
> Nick Coghlan <ncoghlan at gmail.com> a
> écrit :
> > On 13 Feb 2013 09:11, "Tim Delaney"
> > <timothy.c.delaney at gmail.com> wrote:
> > >
> > > On 13 February 2013 09:56, Guido van Rossum
> > > <guido at python.org> wrote:
> > >>
> > >> Frankly, enums are not that useful in small programs. For large
> > >> programs or libraries, and especially for public APIs, the extra
> > >> cost of defining the enum shouldn't count against them.
> > >>
> > >> Let's just import Barry's enums into the stdlib.
> > >
> > >
> > > That's entirely your call. FWIW I probably won't use them, as they
> > > fail
> > to meet my needs for an enum, #1 being not having to specify their
> > values in any way if I don't want to. Once you get past 3 or 4
> > values, it's too easy to miss or reuse a value.
> >
> > What's wrong with enum.make? That just accepts the sequence of names
> > namedtuple style, no values specified anywhere.
>
> What's wrong is that TSBOOWTDI. With enum and enum.make, you have two
> different idioms for declaring enums, while a single class-based
> definition style should suffice.
>
Or just a function idiom. We don't have to support the class-based
definition style either.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130213/ef742cbf/attachment.html>
More information about the Python-ideas
mailing list