perl chomp equivalent in python?

Robert Roy rjroy at takingcontrol.com
Sat Feb 12 15:44:18 EST 2000


As I recall line continuation is by definition  (and not just in
Python)  a backslash followed by a line feed.  Add any whitespace and
you no longer satisfy the definintion. Unless you want to redefine
line continuation, there is really nothing to fix.

Bob


On Thu, 10 Feb 2000 23:25:14 +0100, "Hans Nowak" <hnowak at cuci.nl>
wrote:

>
>On 10 Feb 00, at 16:31, Justin Sheehy wrote:
>
>> > Of all newgroups, certainly comp.lang.python would be 
>> > sympathetic to this issue. ;-)
>> 
>> Last time I checked, Python wasn't sensitive to extra whitespace at
>> the _end_ of a line.
>
>With one exception...
>
>print 1+ \
>      2
>
>In this (admittedly silly) example, whitespace after the \ will cause a 
>SyntaxError: invalid token. I'm curious why this hasn't been fixed yet? 
>Probably a matter of "looks easy, difficult to do"?
>
>--Hans Nowak (zephyrfalcon at hvision.nl)
>Homepage: http://fly.to/zephyrfalcon
>You call me a masterless man. You are wrong. I am my own master.
>




More information about the Python-list mailing list