Lawrence D’Oliveiro <lawrenced...@gmail.com> writes:

> So really, you should write it more like
>
>     s = """this string continues
> on the next line."""
>
> which gets a bit ugly.

For this I have the following treatment
<URL:http://stackoverflow.com/a/2504454/70157>:

    import textwrap

    s = textwrap.dedent("""\
        this string continues
        on the next line.
        """)

> So I propose adapting this convention to triply-quoted strings, as
> follows: lines where the string literal continues must begin with the
> *same* initial whitespace as the line where the string started. This
> initial whitespace is stripped off before including the rest as part
> of the string.

Fortunately, the time machine has provided that in the standard library
so you can choose to use it, even without waiting for a convention :-)

-- 
 \           “Prediction is very difficult, especially of the future.” |
  `\                                                       —Niels Bohr |
_o__)                                                                  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to