On Mon, 22 Nov 2010 15:19:04 +0000 Michael Foord <fuzzyman at voidspace.org.uk> wrote: > On 22/11/2010 15:14, Nick Coghlan wrote: > > On Mon, Nov 22, 2010 at 10:54 AM, Éric Araujo<merwok at netwok.org> wrote: > >>> +.. function:: getgeneratorstate(generator) > >>> + > >>> + Get current state of a generator-iterator. > >>> + > >>> + 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. +1. The problem with int constants is that the int gets printed, not the name, when you dump them for debugging purposes :) cheers Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4