[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

Inada Naoki report at bugs.python.org
Sun Nov 22 04:44:30 EST 2020


Inada Naoki <songofacandy at gmail.com> added the comment:

> I don't think we need two algorithms here. I'm +1 to add str.dedent() which mirroring only inspect.cleandoc().

I withdraw this.  If we add str.dedent(), it must not be optimized for triple-quote literal.

Auto dedenting is very nice to have. It can be different from inspect.cleandoc().

We may able to cleandoc() automatically, even without `from __future__`. This can be different from str.dedent() or auto dedenting.

We already have a separate issue for docstring. And auto dedenting will needs PEP. How about focus on str.dedent() and change the issue title?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36906>
_______________________________________


More information about the Python-bugs-list mailing list