[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: PEP 354: Enumerations in Python
From:       Ben Finney <bignose+hates-spam () benfinney ! id ! au>
Date:       2006-03-01 1:29:20
Message-ID: 87r75n2brj.fsf () rose ! polar ! local
[Download RAW message or body]

Toby Dickenson <tdickenson@devmail.geminidataloggers.co.uk> writes:

> On Monday 27 February 2006 02:49, Ben Finney wrote:
>> Coercing a value from an enumeration to a ``str`` results in the
>> string that was specified for that value when constructing the
>> enumeration::
>
> That sentence seems to assume that all enumeration values will have
> been specified as strings. Thats reasonable, but your description of
> the creation of an enumeration doesnt specify that.

True; I'll need to fix the specification so that it does say that.

>> An enumerated type is created from a sequence of arguments to the
>> type's constructor::
>> 
>>     >>> Weekdays = enum('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat')
>>     >>> Grades = enum('A', 'B', 'C', 'D', 'F')
>
> s/arguments/strings/

s/arguments/string arguments/ :-)

-- 
 \       "Too many pieces of music finish too long after the end."  -- |
  `\                                                  Igor Stravinskey |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic