[Python-Dev] [Python-checkins] r86633 - in python/branches/py3k: Doc/library/inspect.rst Doc/whatsnew/3.2.rst Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS (original) (raw)
Michael Foord fuzzyman at voidspace.org.uk
Mon Nov 22 16:19:04 CET 2010
- Previous message: [Python-Dev] [Python-checkins] r86633 - in python/branches/py3k: Doc/library/inspect.rst Doc/whatsnew/3.2.rst Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS
- Next message: [Python-Dev] [Python-checkins] r86633 - in python/branches/py3k: Doc/library/inspect.rst Doc/whatsnew/3.2.rst Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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: + GENCREATED: Waiting to start execution. + GENRUNNING: Currently being executed by the interpreter. + GENSUSPENDED: Currently suspended at a yield expression. + GENCLOSED: 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.
Michael
Cheers, Nick.
--
READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.
- Previous message: [Python-Dev] [Python-checkins] r86633 - in python/branches/py3k: Doc/library/inspect.rst Doc/whatsnew/3.2.rst Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS
- Next message: [Python-Dev] [Python-checkins] r86633 - in python/branches/py3k: Doc/library/inspect.rst Doc/whatsnew/3.2.rst Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]