by nojs · 4y ago · 0 comments
Is it really? I tend to avoid it in favour of ””” or ‘\n’.join(<list of lines>), because it looks like a mistake.
Triple quotes are kind of annoying if the string is indented, but you can just not indent the string to avoid the whitespace.
No footgun potential, and as others have mentioned the “good usage” would often be bad simply because it ends up looking like a mistake even if it’s intentional.
https://docs.python.org/3/library/textwrap.html#textwrap.ded...
or inspect.cleandoc.
https://docs.python.org/3.8/library/inspect.html#inspect.cle...