Bug in string.lstrip?

Michael Hudson mwh at python.net
Mon Aug 23 12:12:45 EDT 2004


Brian <brian at nospam.com> writes:

> Hello - has anyone else had trouble with string.lstrip stripping too
> much? Here's what I get (Python 2.3.4):
> 
>  >>> import string
>  >>> string.lstrip("test/one/two/a.b.c", "test/one/")
> 'wo/a.b.c'
>  >>> string.lstrip("test/one/two/a.b.c", "test/one")
> 'wo/a.b.c'
>  >>> string.lstrip("test/one/two/a.b.c", "test/one/tw")
> 'a.b.c'
>  >>>
> 
> Similar things happened with the strip() string method. Am I missing
> something, or should I file a bug report?

Strip considers the second parameter as a *set* of characters to
remove.

Cheers,
mwh

-- 
  <dash> web in my head get it out get it out
                                                -- from Twisted.Quotes



More information about the Python-list mailing list