Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

While the string method works pretty well, I do not think this is the best way. 
If 98% of multiline string will need deindenting, it is better to do it by 
default. For those 2% that do not need deintentation, it can be prohibited by 
adding the backslash followed by a newline at first position (except the start 
of the string). For example:

smile = '''\

 XX
 XX      X
          X
    XXX   X
          X
 XX      X
 XX

\
'''

Yes, this is breaking change. But we have import from __future__ and 
FutureWarning. The plan may be:

3.9. Implement "from __future__ import deindent".
3.11. Emit a FutureWarning for multiline literals that will be changed by 
dedending if "from __future__ import deindent" is not specified.
3.13. Make it the default behavior.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36906>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to