Message342931
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. |
|
Date |
User |
Action |
Args |
2019-05-20 16:42:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, gregory.p.smith, steven.daprano, mbussonn, pablogsal, remi.lapeyre |
2019-05-20 16:42:51 | serhiy.storchaka | set | messageid: <1558370571.06.0.805831845594.issue36906@roundup.psfhosted.org> |
2019-05-20 16:42:51 | serhiy.storchaka | link | issue36906 messages |
2019-05-20 16:42:50 | serhiy.storchaka | create | |
|