[Patches] [Patch #103029] Implementation of chomp() on string objects.

noreply@sourceforge.net noreply@sourceforge.net
Fri, 29 Dec 2000 09:08:27 -0800


Patch #103029 has been updated. 

Project: python
Category: core (C code)
Status: Rejected
Submitted by: bjorn_pettersen
Assigned to : nobody
Summary: Implementation of chomp() on string objects.

Follow-Ups:

Date: 2000-Dec-29 09:08
By: bjorn_pettersen

Comment:
It was almost universally felt (on c.l.py) that a method doing this would
be a good idea (since rstrip does too much, and splitlines() would be
rather cryptic when used in the common "while 1:" idiom -- not to mention
that the common "line = line[:-1]" is completely wrong).

Naming was an issue. I don't do Perl, but even I know what chomp is after a
dozen or so requests on c.l.py. Perhaps rmLineTerm() or some such would be
better?

If this is reconsidered, I'd be glad to implement a patch for both the
unicode string and the documentation.
-------------------------------------------------------

Date: 2000-Dec-28 09:52
By: gvanrossum

Comment:
Rejecting this now.  Comments on python-dev are mostly negative.

Note that there's also splitlines().
-------------------------------------------------------

Date: 2000-Dec-28 07:02
By: gvanrossum

Comment:
Hm. s.rstrip() does the same thing (plus strips trailing whitespace, which
is rarely a problem).  Do you really need this function?  If so, please
don't call it chomp() -- that's a Perl-ism that makes no sense to anyone
else.

*If* (and I say *if*) this is accepted, we would require a Unicode version
and documentation as well.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=103029&group_id=5470