New submission from alexlc <a...@niebla.co.uk>:

Examples of bad behaviour:

>>> 'abacde'.lstrip('ab')
'cde'
>>> 'abaaacde'.lstrip('ab')
'cde'
>>> 'aabacde'.lstrip('aab')
'cde'
>>> 'abcede'.rstrip( 'de' )
'abc'
>>> 'abacdeaab'.strip('ab')
'cde'

Probably a few more similar to these will fail as well.

I have tested this with a fairly recent 2.5 (maybe 2.53 maybe 2.54), and
with 2.6.1. I have commented this to a friend and he recalls problems
similar to these with lstrip and rstrip a few years ago, so it might
have been an early 2.4 version or a late 2.3.

Thanks.

----------
components: Library (Lib)
messages: 82480
nosy: alexlc
severity: normal
status: open
title: strip, rstrip & lstrip bug
type: behavior
versions: Python 2.5, Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5318>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to