how to "normalize" indentation sources

Tim Peters tim.peters at gmail.com
Thu May 25 11:19:08 EDT 2006


[John Machin, quoting reindent.py docs]
>> remove empty lines at the end of files.  Also ensure the last line ends
>> with a newline.

[John Salerno]
> don't those two things conflict with one another?

No.  This is the repr of a file with (3) empty lines at the end:

    "a file\n\n \n  \t    \n"

reindent.py changes that to:

    "a file\n"

This is the repr of a file with no newline at the end:

    "a file"

reindent.py changes that to:

    "a file\n"

> or is the newline added after empty lines are removed?

False dichotomy ;-)



More information about the Python-list mailing list