Suggest using textwrap.dedent()
to keep indentation even with triple-quote multi-line strings
#26
Labels
textwrap.dedent()
to keep indentation even with triple-quote multi-line strings
#26
In section "Implicit multi-line strings vs triple-quote
"""
" you can get the best of both worlds (avoiding ugly new-lines as well as keeping indentation) by usingtextwrap.dedent()
, for example:You can also achieve more compact spacing if you start the string in the second line (but then you need to add a backslash after the opening triple-quote to avoid a leading newline):
I slightly prefer the second one, but I guess it's a matter of taste.
The text was updated successfully, but these errors were encountered: