On Tue, Nov 23, 2010 at 1:19 AM, Michael Foord
<fuzzy...@voidspace.org.uk> wrote:
> On 22/11/2010 15:14, Nick Coghlan wrote:
>> On Mon, Nov 22, 2010 at 10:54 AM, Éric Araujo<mer...@netwok.org>  wrote:
>>>> +    Possible states are:
>>>> +      GEN_CREATED: Waiting to start execution.
>>>> +      GEN_RUNNING: Currently being executed by the interpreter.
>>>> +      GEN_SUSPENDED: Currently suspended at a yield expression.
>>>> +      GEN_CLOSED: Execution has completed.
>>>
>>> I wonder if those shouldn’t be marked up as :data: or something to make
>>> them indexed.
>>
>> The same definitions are in the docstrings, and they're just integer
>> constants so I'm not sure why anyone would be looking them up
>> directly. Still, if someone with greater Sphinx-fu thinks additional
>> markup would be helpful, I have no problem with them adding it :)
>>
>
> Why not use string constants instead? You lose comparability (less than /
> greater than) but gain readability. Comparability may be a requirement - of
> course if Python had an Enum type we could use that and have both.

With only 4 states, comparability isn't really necessary. I'm just so
used to using the range() trick as a replacement for the lack of
proper Enum type that using strings instead didn't even occur to me.

The lack of printability did bother me a bit, so yeah, +1 from me as
well (I've reopened the relevant issue to remind me to change it
before beta 1).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to