Indented multi-line strings

Dan Strohl D.Strohl at F5.com
Fri Jun 1 11:20:19 EDT 2018


> 
> It would probably have to go via python-ideas, but if it gets the OK there I
> doubt it would need a PEP.
> 

Cool, thanks!

> There are a few key questions I'd expect to see come up.
> 
> Why does this need to be a string method? Why can't it be a standalone
> function? Maybe you should publish an implementation on PyPI, collect some
> data on how popular it is, and then if it's widely used, propose it for inclusion
> in the stdlib at that point? By making it a string method, you're also restricting
> its use to users of recent versions of Python, whereas a PyPI implementation
> would work for everyone.

Good point, so, basically, there already is a function for this built in textwrap.dedent() and textwrap.indent(), I would think (hope) that that would answer that question.





More information about the Python-list mailing list