string() - Is this some kind of sick joke?

Lyle Johnson lyle at
Wed Apr 9 22:24:55 CEST 2003

Daniel Gowans wrote:

> What gives?  Did I get the bogus version?  Is this wishful thinking
> documentation?  I also tried  y.strip("'")  with the same results.
> If this can't be done this way (oh, how I love chomp()) then is there
> a simple, elegant way to do it?

Starting with Python 2.2.2 (but *not* in Python 2.2.1), the strip(), 
lstrip() and rstrip() methods for string objects accept this optional 
argument. I would not have expected the 'string' module to pick up these 
extras, however, since it's deprecated.

More information about the Python-list mailing list