[Python-ideas] Enums
Nick Coghlan
ncoghlan at gmail.com
Fri Jul 29 02:27:44 CEST 2011
On Fri, Jul 29, 2011 at 9:58 AM, Raymond Hettinger
<raymond.hettinger at gmail.com> wrote:
> P.S. I used the term "language" instead of stdlib because I expect
> enums to be like decorators and context managers in that they
> will be used almost everywhere -- you won't be able to ignore them.
> Effectively, they will become a core language feature.
I agree with this - and I think it's the named value aspect that will
make them so pervasive. It's why I keep hitting on
collections.namedtuple as a source of inspiration - it adds as little
as possible to ordinary tuples to provide the additional benefits.
Enums, on the other hand, come with a lot of excess baggage that many
potential use cases simply don't need.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list