Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106941
| From | Grant Edwards <grant.b.edwards@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Enum questions. |
| Date | 2016-04-13 13:50 +0000 |
| Message-ID | <mailman.72.1460555456.15650.python-list@python.org> (permalink) |
| References | <570E1B98.4080904@rece.vub.ac.be> <CAGgTfkPfcwamSgRFH9PwuVV4MGsnDwcZOD1=bS=7z+RWnEP0eg@mail.gmail.com> <nelir9$163$1@ger.gmane.org> |
On 2016-04-13, Michael Selik <michael.selik@gmail.com> wrote:
> On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon <antoon.pardon@rece.vub.ac.be> wrote:
>
>> I have been looking at the enum documentation and it seems enums
>> are missing two features I rather find important.
>>
>> 1) Given an Enum value, someway to get the next/previous
>> one
>>
>> 2) Given two Enum values, iterate over the values between
>> them.
>>
>> Did I miss those in the documentation or are they really missing?
>
> An Enum corresponds to "nominal" data that is coded as a number
> simply for storage rather than meaning.
FWIW, as an old Pascal programmer, I too would have been surprised
that an "enum" is not ordinal and doesn't support a next/prev and
iteration.
As an old C programmer, not so much. :)
--
Grant Edwards grant.b.edwards Yow! Today, THREE WINOS
at from DETROIT sold me a
gmail.com framed photo of TAB HUNTER
before his MAKEOVER!
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Enum questions. Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-13 13:50 +0000
Re: Enum questions. Marko Rauhamaa <marko@pacujo.net> - 2016-04-13 17:07 +0300
Re: Enum questions. Ethan Furman <ethan@stoneleaf.us> - 2016-04-13 07:21 -0700
Re: Enum questions. Ethan Furman <ethan@stoneleaf.us> - 2016-04-13 14:13 -0700
csiph-web