Equivalent of Perl chomp?

Stefan Schwarzer s.schwarzer at ndh.net
Thu Jan 31 18:27:42 EST 2002


Paul Rubin wrote:
> "Paul Watson" <pwatson at mail.com> writes:
> > Is chomp worth considering as an addition to the string functions?
> 
> I think it should be added.  I constantly find myself wanting it.

Some say they miss chomp, some not. (And I can't remember ever desiring
it in Python, though I used chomp sometimes in my Perl days.)

It might be interesting to give some examples of code that "wants" chomp.
We then could see if there is a pythonic way to make a chomp-like function
unnecessary. Maybe there are better ways.

Stefan



More information about the Python-list mailing list