osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Indented multi-line strings


On Wed, May 23, 2018 at 8:08 PM, Mikhail V <mikhailwas at gmail.com> wrote:
> On Wed, May 23, 2018 at 4:19 PM, Dan Strohl <D.Strohl at f5.com> wrote:

> data = /// sN         # and
> data = /// tN
>
> Where N - is the amount of characters, spaces (s) or
> tabs (t).
> This should cover most use cases.
> It implies of course that the user should know himself
> what he is doing.
>
> More concrete example:
>
> def func():
>     foobar
>     data = /// s2
>       first line
>       last line
>     foobar
>
> will store same data as:
> data = "first linelast line"

oops, I meant it to be:
data = "first line\nlast line"

sorry for possible confusion

>
> (assuming of course no trailing spaces were
> in original lines)