Commit 1f04610b authored by Martin v. Löwis's avatar Martin v. Löwis

Make strip behave as documented. Will backport to 2.2.3.

parent 16449867
...@@ -74,14 +74,14 @@ def swapcase(s): ...@@ -74,14 +74,14 @@ def swapcase(s):
return s.swapcase() return s.swapcase()
# Strip leading and trailing tabs and spaces # Strip leading and trailing tabs and spaces
def strip(s): def strip(s, chars=None):
"""strip(s) -> string """strip(s) -> string
Return a copy of the string s with leading and trailing Return a copy of the string s with leading and trailing
whitespace removed. whitespace removed.
""" """
return s.strip() return s.strip(chars)
# Strip leading tabs and spaces # Strip leading tabs and spaces
def lstrip(s): def lstrip(s):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment