strip bug?

Eduardo xcesar at gmail.com
Tue Feb 24 18:15:54 EST 2015


Well, from the docstring of strip:

------
S.strip([chars]) -> string or unicode

Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unicode before stripping
------

In this case 'http://thunder'.strip('http://') is the same as 'http://thunder'.strip('htp:/') and any character of the string that is passed to the method will be removed. 



More information about the Python-list mailing list