[issue5439] string.strip behaves strangly

Martin v. Löwis report at bugs.python.org
Sun Mar 8 09:08:23 CET 2009


Martin v. Löwis <martin at v.loewis.de> added the comment:

It's a feature you don't understand. .strip() doesn't expect the
substring to be stripped, but a list of characters. Since the strip
characters contain /, all leading a,/,b characters get stripped (in any
order:

py> "////aaab/csdfhkab///c".strip("a/b")
'csdfhkab///c'

----------
nosy: +loewis
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5439>
_______________________________________


More information about the Python-bugs-list mailing list