perl chomp equivalent in python?

Jeff Bauer jbauer at rubic.com
Thu Feb 10 16:12:39 EST 2000


Justin Sheehy wrote:
<snip>
> The need for this is also somewhat doubtful.  I have yet 
> to see a real (not contrived) example where string.rstrip() 
> wasn't the right choice for this sort of thing.

In most cases trailing whitespace is probably insignificant,
but it would be best not to assume this for all circumstances 
(e.g. tab-delimited files).

I would not want to see string.rstrip() used in library
modules, since it could result in a loss of data where the
user might not be expecting whitespace to disappear.  

Of all newgroups, certainly comp.lang.python would be 
sympathetic to this issue. ;-)

Jeff Bauer
Rubicon Research




More information about the Python-list mailing list