newbie question: if var1 == var2:

MRAB google at
Fri Dec 12 17:47:43 CET 2008

Kirk Strauser wrote:
> At 2008-12-12T15:35:11Z, "J. Cliff Dyer" <jcd at> writes:
>> Python has a version equally good:
>> def chomp(s):
>>     return s.rstrip('\r\n')
>> You'll hardly miss Perl at all. ;)
> I haven't missed Perl in years!  I just wish there was a basestring.stripeol
> method because I seem to end up writing the inline version of "chomp" every
> time I iterate across a file.
Python is open source. You could suggest adding it and/or provide a patch.

More information about the Python-list mailing list