On 04/13/2016 07:21 AM, Ethan Furman wrote:
On 04/13/2016 07:07 AM, Marko Rauhamaa wrote:
class Color(enum.Enum):
red
blue
green
This last one is to the point but raises a NameError.
Using the aenum library that last one is possible. It also has
NamedConstan
On 04/13/2016 07:07 AM, Marko Rauhamaa wrote:
class Color(enum.Enum):
red
blue
green
This last one is to the point but raises a NameError.
Using the aenum library that last one is possible. It also has
NamedConstant and a metaclass-derived NamedTuple!
--
On Wed, Apr 13, 2016 at 7:50 AM, Grant Edwards
wrote:
> 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.
They do support iteration, but it's by order of declaration, not by value.
--
https://mail.p
Grant Edwards :
> On 2016-04-13, Michael Selik wrote:
>> 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/pre
On 2016-04-13, Michael Selik wrote:
> On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon
> 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)
On Wednesday, April 13, 2016 at 5:39:13 PM UTC+5:30, Michael Selik wrote:
> On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon
> 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
On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon
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
On 04/13/2016 12:12 PM, Antoon Pardon 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.
D
Rustom Mody :
> Given the eg in the docs:
> from enum import Enum
> class Color(Enum):
> red = 1
> blue = 2
> green = 3
>
Color(Color.red.value+1)
>
But:
>>> class Color(enum.Enum):
... red = 0xff
... green = 0x00ff00
... blue = 0xff
...
>>> Colo
On Wednesday, April 13, 2016 at 3:43:41 PM UTC+5:30, Antoon Pardon 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, it
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
11 matches
Mail list logo