[issue5439] string.strip behaves strangly

2009-03-08 Thread Martin v. Löwis
Martin v. Löwis 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") 'csdfhk

[issue5439] string.strip behaves strangly

2009-03-07 Thread Ezio Melotti
Ezio Melotti added the comment: http://docs.python.org/library/string.html#string.strip string.strip(s[, chars]) Return a copy of the string with leading and trailing characters removed. If chars is omitted or None, whitespace characters are removed. If given and not None, chars must be a

[issue5439] string.strip behaves strangly

2009-03-07 Thread Dongwook Jang
New submission from Dongwook Jang : Python 2.4.2 (#1, Mar 4 2008, 22:56:43) [GCC 3.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> temp = "a/b/c" >>> temp.strip("a") '/b/c' >>> temp.strip("a/") 'b/c' >>> temp.strip("a/b") 'c' >>> temp.strip("a/b/") 'c' >