[Python-ideas] New str whitespace cleaning method?

Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de
Fri May 24 22:06:07 CEST 2013


One clean solution might be (now don't shout at me. I know it would be a
profound change with lots of compatibility problems, and its just a wild
thought that I'm not advocating for):
Triple-quoted strings could be made a subclass of str, and their formatting
methods (at least strip, lstrip, ljust, rjust) could overwrite those of str
to operate on a per-line basis, e.g., strip() and lstrip() could remove
whitespace from the end and the beginning of each line.







More information about the Python-ideas mailing list