[Python-Dev] Triple-quoted strings and indentation

Andrew Durdin adurdin at gmail.com
Sun Jul 10 13:38:45 CEST 2005


On 7/7/05, Terry Reedy <tjreedy at udel.edu> wrote:
> 
> I believe there were some current alternatives and concerns already
> expressed that have not been included yet that maybe should be.

Yes; Nick pointed me to one, and I'll be looking at that and the
related discussions before redrafting; I'll also have a further look
for other similar proposals.
 
> Some of your examples look worse than needed by putting the first line
> after the triple quote instead of escaping the first newline like you did
> elsewhere.

In general, I wanted to preserve as much as possible the way that the
string was originally written (as these examples were taken and
adapted from the standard library source).  In the example with the
embedded python code, I felt it was significantly clearer if the
initial newline was escaped.

> Having separate rules for doc strings and other tq strings would be a
> nuisance.

I totally agree -- and if the proposal as written gives that
impression then I'll correct it. What I was trying to say about
docstrings was that the change would have no effect on the result
after processing them with docutils or anything else that follows PEP
257 -- which is very significant in terms of backward compatibility,
as docstrings are AFAICT the leading use of TQS's (by a large margin).

Cheers,

Andrew.


More information about the Python-Dev mailing list