[Python-ideas] Dart like multi line strings identation

Marius Räsener m.raesener at gmail.com
Sat Mar 31 10:50:03 EDT 2018


Hey List,

this is my very first approach to suggest a Python improvement I'd think
worth discussing.

At some point, maybe with Dart 2.0 or a little earlier, Dart is now
supporting multiline strings with "proper" identation (tried, but I can't
find the according docs at the moment. probably due to the rather large
changes related to dart 2.0 and outdated docs.)

What I have in mind is probably best described with an Example:

print("""
    I am a
    multiline
    String.
    """)

the closing quote defines the "margin indentation" - so in this example all
lines would get reduces by their leading 4 spaces, resulting in a "clean"
and unintended string.

anyways, if dart or not, doesn't matter - I like the Idea and I think
python3.x could benefit from it. If that's possible at all :)

I could also imagine that this "indentation cleanup" only is applied if the
last quotes are on their own line? Might be too complicated though, I can't
estimated or understand this...

thx for reading,
Marius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180331/20728b0d/attachment.html>


More information about the Python-ideas mailing list