Message356160
Is there a reason folks are supporting a textwrap.dedent-like behavior over the generally cleaner inspect.cleandoc behavior? The main advantage to the latter being that it handles:
'''First
Second
Third
'''
just fine (removing the common indentation from Second/Third), and produces identical results with:
'''
First
Second
Third
'''
where textwrap.dedent behavior would leave the first string unmodified (because it removes the largest common indentation, and First has no leading indentation), and dedenting the second, but leaving a leading newline in place (where cleandoc removes it), that can only be avoided by using the typically discouraged line continuation character to make it:
'''\
First
Second
Third
'''
cleandoc behavior means the choice of whether the text begins and ends on the same line at the triple quote doesn't matter, and most use cases seem like they'd benefit from that flexibility. |
|
Date |
User |
Action |
Args |
2019-11-07 00:25:47 | josh.r | set | recipients:
+ josh.r, rhettinger, gregory.p.smith, steven.daprano, methane, serhiy.storchaka, mbussonn, pablogsal, remi.lapeyre, Marco Sulla |
2019-11-07 00:25:47 | josh.r | set | messageid: <1573086347.2.0.280349568815.issue36906@roundup.psfhosted.org> |
2019-11-07 00:25:47 | josh.r | link | issue36906 messages |
2019-11-07 00:25:46 | josh.r | create | |
|