<br><br><div class="gmail_quote">On 16 August 2011 22:58, Ben Finney <span dir="ltr"><<a href="mailto:ben%2Bpython@benfinney.id.au">ben+python@benfinney.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Michael Foord <<a href="mailto:fuzzyman@gmail.com">fuzzyman@gmail.com</a>> writes:<br>
<br>
> How about *another* string prefix for dedented strings:<br>
><br>
> class Thing(object):<br>
>     d"""<br>
>     This text will be,<br>
>     nicely dedented,<br>
>     thank you very much.<br>
>     """"<br>
<br>
</div>class Thing(object):<br>
    """ This literal string contains leading and trailing whitespace.<br>
<br>
        It also is indented. But none of that will show up when the<br>
        docstring is processed and presented to the user.<br>
<br>
        Because it is a docstring that conforms to PEP 257, the<br>
        indentation will be handled properly by PEP-257 conformant<br>
        docstring processors.<br>
<br>
        <<a href="http://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation" target="_blank">http://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation</a>>_<br>
        gives the specification for how indentation shall be handled by<br>
        code that processes Python docstrings.<br></blockquote><div><br><br>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). <br>
<br>Michael<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
        The programmer inspecting the value of ‘__doc__’ will still see<br>
        the leading, trailing, and indenting whitespace; but the<br>
        programmer doing so isn't the recipient of the docstring as a<br>
        docstring.<br>
<br>
        So I don't see what problem there is to be solved.<br>
<br>
        """<br>
    pass<br>
<br>
--<br>
 \     “Guaranteed to work throughout its useful life.” —packaging for |<br>
  `\                                          clockwork toy, Hong Kong |<br>
_o__)                                                                  |<br>
<font color="#888888">Ben Finney<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><pre cols="72"><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br><br>May you do good and not evil<br>May you find forgiveness for yourself and forgive others<br>
May you share freely, never taking more than you give.<br>-- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a></pre>
<br>