[Python-3000] print() parameters in py3k

Giovanni Bajo rasky at develer.com
Mon Nov 20 15:58:44 CET 2006


Guido van Rossum wrote:

>> The only thing I would prefer is instead of 'end' have 'newline' and
>> have that be a boolean since I don't see a need to support different
>> line endings.  I realize the difference between ``end=''`` and
>> ``newline=False`` is minimal beyond more typing, but for some reason
>> my head just keeps telling me I prefer the latter for clarity
>> reasons. 
>> 
>> Otherwise +1 from me.
> 
> Oh, but I *do* see a use case for other line endings. E.g. when
> writing a Windows file or a standards-compliant email from within
> Unix, end="\r\n" would be helpful. In practice it probably would be a
> variable set from a config option.

Uhm, but then, why not simply:

println(x,y,z) -> append "\n"
print(x,y,z) -> no terminator
print(x,y,z,"\r\n") -> custom terminator

Giovanni Bajo



More information about the Python-3000 mailing list