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

Steven D'Aprano report at bugs.python.org
Sat Nov 21 06:08:15 EST 2020


Steven D'Aprano <steve+python at pearwood.info> added the comment:

A string prefix would be a large language change that would need to go through Python-Ideas, a PEP and Steering Council approval. Let's not go there :-)

A new string method is a comparatively small new feature that probably won't need a PEP or Steering Council approval.

A compile-time optimization is an implementation feature, not a language feature. Whether devs want to follow up with more string optimizations like 'spam'.upper() is entirely up to them.

Backwards compatibility implies that textwrap.dedent is not going away any time soon, but it should probably become a thin wrapper around str.dedent at some point.

----------

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


More information about the Python-bugs-list mailing list