On 29 July 2011 01:27, Nick Coghlan
<ncoghlan@gmail.com> wrote:
On Fri, Jul 29, 2011 at 9:58 AM, Raymond Hettinger
> 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.
I agree "named values" would get us *most* of the value, and would both be less contentious and provide a common building block for third party libraries to build interesting and perhaps esoteric uses on.
I *like* grouped named values (I think they make nice apis to read and use when used appropriately), but hey-ho.
Michael
Cheers,
Nick.
--
Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia