'strip' documentation for beginners <g>

Dan Rawson daniel.rawson.take!this!out! at asml.nl
Tue Mar 4 07:30:40 EST 2003


The documentation for string.strip states that it can take an optional second parameter, but it doesn't appear to work:


07:23:06 $ python
Python 2.2.1 (#1, Sep 12 2002, 16:24:44)
[GCC 3.1.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
 >>> import string
 >>> string.strip("test", "t")
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: strip() takes exactly 1 argument (2 given)
 >>>

I would expect the above example to return "es", having stripped the "t" off of each end.

Or did I miss something obvious???  I DID do a search in the What's New in the 2.2.2 documentation.

TIA . . . .

Dan





More information about the Python-list mailing list