[Python-Dev] Optional separatorargument for file.writelines() and StringIO.writelines()

Dmitry Vasiliev lists at hlabs.spb.ru
Wed Feb 25 06:13:39 EST 2004


Raymond Hettinger wrote:
> Currently, writelines() does not add trailing line separators..
> This is fine when working with readlines() but a PITA in other situations.
> 
> If we added an optional separator argument, it would be easier to add
> newlines and we would gain some of the flexibility of str.join() at full 
> C speed.

Maybe not a separator but suffix, so newline will be added to last line too?

-- 
Dmitry Vasiliev (dima at hlabs.spb.ru)
     http://hlabs.spb.ru



More information about the Python-Dev mailing list