Equivalent of Perl chomp?

François Pinard pinard at iro.umontreal.ca
Thu Jan 31 11:10:26 EST 2002


[Steve Holden]

> [...] if you find yourself need chomp() all the time, maybe there's a
> more Pythonic solution to your problems which your current Perlishness
> is causing you to overlook.

My feeling as well.  When I first came to Python from Perl, `chop' and
`chomp' were irritatingly missing.  But rather rapidly, I came to use
methods not needing them, and I now think that my style was questionable
in the beginnings.  I think adding `chomp' to Python might please newcomers
from Perl, granted, but it would encourage bad Python habits.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list