[Python-ideas] Syntax for dedented strings
David Townshend
aquavitae69 at gmail.com
Fri Aug 19 16:32:52 CEST 2011
+1 for strings in unit tests, but not so useful for docstrings. But the
proposal was as a new string type, not necessarily docstrings. But maybe a
string method would be better:
>>> """
... This
... is
... indented.""".deindent()
"""
This
is
indented"""
On Aug 19, 2011 2:55 PM, "Dag Odenhall" <dag.odenhall at gmail.com> wrote:
>
> On Tue, 2011-08-16 at 23:43 +0100, Michael Foord wrote:
> > The place I'm concerned about is the interactive interpreter, virtually
the
> > only place I look at docstrings that isn't directly in the source code
(or
> > pre-processed by a doc tool - but I don't care about that).
>
> Why don't you use bpython? It shows the docstring automatically as
> you're typing a class, without all the methods, and properly formatted.
>
> Also if you're working with docstrings yourself there's inspect.getdoc
> which handles whitespace/indentation.
>
> (But I still consider your proposal useful.)
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110819/f4d2a9a4/attachment.html>
More information about the Python-ideas
mailing list