objstr: *strip(): If nothing is stripped, don't create dup string.

This commit is contained in:
Paul Sokolovsky
2014-05-30 03:11:44 +03:00
parent bcdffe53c6
commit 8827682b35
2 changed files with 10 additions and 0 deletions

View File

@@ -31,3 +31,7 @@ print(" a".rstrip())
print("a ".strip())
print("a ".lstrip())
print("a ".rstrip())
# Test that stripping unstrippable string returns original object
s = "abc"
print(id(s.strip()) == id(s))