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

Rémi Lapeyre report at bugs.python.org
Mon May 20 10:57:55 EDT 2019


Rémi Lapeyre <remi.lapeyre at henki.fr> added the comment:

Hi @steven.daprano, @gregory.p.smith. I added the first version of my PR for review.

One issue with it is that in:

def f():
    return "   foo".dedent()

f will have both "   foo" and "foo" in its constants even if the first is not used anymore. Removing it requires looping over the code once more while marking the constants seen in a set and I was not sure if this was ok.

----------

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


More information about the Python-bugs-list mailing list