This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients r.david.murray
Date 2010-02-11.18:57:18
SpamBayes Score 4.2171774e-08
Marked as misclassified No
Message-id <1265914642.07.0.496715269242.issue7913@psf.upfronthosting.co.za>
In-reply-to
Content
Cmd currently has undocumented support for using the docstrings of 'do_' methods as the documentation for those methods.  This is a very convenient facility, except that it leads to documentation being printed with a lot of leading whitespace.

I propose to enhance the docstring support to strip the leading whitespace from the docstring, and to document this facility.  The proposed stripping algorithm is to strip a number of characters equal to the whitespace on the first non-blank line of the docstring.  This means that existing docstrings, which will typically start right after the first """, will be displayed as they were previously, but that a docstring can be formatted by starting the documentation on a new line after the """, and whitespace will be properly stripped.

Patch attached with test and documentation update.
History
Date User Action Args
2010-02-11 18:57:22r.david.murraysetrecipients: + r.david.murray
2010-02-11 18:57:22r.david.murraysetmessageid: <1265914642.07.0.496715269242.issue7913@psf.upfronthosting.co.za>
2010-02-11 18:57:20r.david.murraylinkissue7913 messages
2010-02-11 18:57:20r.david.murraycreate