From 8827682b35f6fefb4604f28447b77e8443cbf1cb Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 30 May 2014 03:11:44 +0300 Subject: objstr: *strip(): If nothing is stripped, don't create dup string. --- tests/basics/string_strip.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/basics') diff --git a/tests/basics/string_strip.py b/tests/basics/string_strip.py index 70c74b383..5d99a78e5 100644 --- a/tests/basics/string_strip.py +++ b/tests/basics/string_strip.py @@ -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)) -- cgit v1.2.3