diff options
author | Guido van Rossum <guido@python.org> | 2001-09-24 16:51:54 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-09-24 16:51:54 (GMT) |
commit | bb77e6801ea07653e3cc66dbfaa3b5102eae16e7 (patch) | |
tree | 99a4a2b967dad5571bd3c4b1a48ebdc75e01ab79 /Lib | |
parent | ff0e6d6ef542b5b4f3c31786aa152cec68598d4f (diff) | |
download | cpython-bb77e6801ea07653e3cc66dbfaa3b5102eae16e7.zip cpython-bb77e6801ea07653e3cc66dbfaa3b5102eae16e7.tar.gz cpython-bb77e6801ea07653e3cc66dbfaa3b5102eae16e7.tar.bz2 |
Change string comparison so that it applies even when one (or both)
arguments are subclasses of str, as long as they don't override rich
comparison.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_descr.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 9e8565f..ed3cea4 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1555,7 +1555,7 @@ def inherits(): self._rev = self.__class__("".join(L)) return self._rev s = madstring("abcdefghijklmnopqrstuvwxyz") - #XXX verify(s == "abcdefghijklmnopqrstuvwxyz") + verify(s == "abcdefghijklmnopqrstuvwxyz") verify(s.rev() == madstring("zyxwvutsrqponmlkjihgfedcba")) verify(s.rev().rev() == madstring("abcdefghijklmnopqrstuvwxyz")) for i in range(256): @@ -1569,12 +1569,12 @@ def inherits(): base = "\x00" * 5 s = madstring(base) - #XXX verify(s == base) + verify(s == base) verify(str(s) == base) verify(str(s).__class__ is str) verify(hash(s) == hash(base)) - #XXX verify({s: 1}[base] == 1) - #XXX verify({base: 1}[s] == 1) + verify({s: 1}[base] == 1) + verify({base: 1}[s] == 1) verify((s + "").__class__ is str) verify(s + "" == base) verify(("" + s).__class__ is str) @@ -1613,14 +1613,14 @@ def inherits(): verify(s.lower() == base) s = madstring("x y") - #XXX verify(s == "x y") + verify(s == "x y") verify(intern(s).__class__ is str) verify(intern(s) is intern("x y")) verify(intern(s) == "x y") i = intern("y x") s = madstring("y x") - #XXX verify(s == i) + verify(s == i) verify(intern(s).__class__ is str) verify(intern(s) is i) |