Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #29425 > unrolled thread
| Started by | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| First post | 2012-09-18 22:34 +1000 |
| Last post | 2012-09-18 22:34 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
SOLVED: Docstring parsing and formatting Ben Finney <ben+python@benfinney.id.au> - 2012-09-18 22:34 +1000
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2012-09-18 22:34 +1000 |
| Subject | SOLVED: Docstring parsing and formatting |
| Message-ID | <mailman.869.1347971665.27098.python-list@python.org> |
Joel Goldstick <joel.goldstick@gmail.com> writes: > On Tue, Sep 18, 2012 at 1:03 AM, Terry Reedy <tjreedy@udel.edu> wrote: > > On 9/17/2012 10:03 PM, Ben Finney wrote: > >> Where can I find a standard implementation of the docstring parsing > >> and splitting algorithm from PEP 257? > > Do you know about pydoc? I haven't looked at its source, but since it > does a great job of printing documentation from docstrings it might > contain what you need Yes, I have now learned about the ‘pydoc’ module following the lead from investigating the interactive interpreter's ‘help’ function <URL:http://docs.python.org/library/pydoc.html>. The ‘pydoc.splitdoc’ function, though not documented in the library documentation, does what I need. It takes a docstring as input, and returns a tuple of (synopsis, description). Thanks to everyone who helped. -- \ “Value your freedom or you will lose it, teaches history. | `\ “Don't bother us with politics,” respond those who don't want | _o__) to learn.” —Richard Stallman, 2002 | Ben Finney
Back to top | Article view | comp.lang.python
csiph-web