diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-06-11 21:38:39 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-06-11 21:38:39 (GMT) |
commit | 5de48bdd195b14426c772b4c61290aef7f33e3ec (patch) | |
tree | e4411088f62f76b183b18d543b4c4b64d4076d65 /Lib/test/test_set.py | |
parent | 80bfb725af0809308264d526ac6a024fc8386643 (diff) | |
download | cpython-5de48bdd195b14426c772b4c61290aef7f33e3ec.zip cpython-5de48bdd195b14426c772b4c61290aef7f33e3ec.tar.gz cpython-5de48bdd195b14426c772b4c61290aef7f33e3ec.tar.bz2 |
Simplify various spots where: str() is called on something
that already is a string or the existence of the str class
is checked or a check is done for str twice. These all stem
from the initial unicode->str replacement.
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r-- | Lib/test/test_set.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index e411025..ee570f0 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -72,7 +72,7 @@ class TestJointOps(unittest.TestCase): self.assertEqual(type(u), self.thetype) self.assertRaises(PassThru, self.s.union, check_pass_thru()) self.assertRaises(TypeError, self.s.union, [[]]) - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: self.assertEqual(self.thetype('abcba').union(C('cdc')), set('abcd')) self.assertEqual(self.thetype('abcba').union(C('efgfe')), set('abcefg')) self.assertEqual(self.thetype('abcba').union(C('ccb')), set('abc')) @@ -96,7 +96,7 @@ class TestJointOps(unittest.TestCase): self.assertEqual(self.s, self.thetype(self.word)) self.assertEqual(type(i), self.thetype) self.assertRaises(PassThru, self.s.intersection, check_pass_thru()) - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: self.assertEqual(self.thetype('abcba').intersection(C('cdc')), set('cc')) self.assertEqual(self.thetype('abcba').intersection(C('efgfe')), set('')) self.assertEqual(self.thetype('abcba').intersection(C('ccb')), set('bc')) @@ -121,7 +121,7 @@ class TestJointOps(unittest.TestCase): self.assertEqual(type(i), self.thetype) self.assertRaises(PassThru, self.s.difference, check_pass_thru()) self.assertRaises(TypeError, self.s.difference, [[]]) - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: self.assertEqual(self.thetype('abcba').difference(C('cdc')), set('ab')) self.assertEqual(self.thetype('abcba').difference(C('efgfe')), set('abc')) self.assertEqual(self.thetype('abcba').difference(C('ccb')), set('a')) @@ -146,7 +146,7 @@ class TestJointOps(unittest.TestCase): self.assertEqual(type(i), self.thetype) self.assertRaises(PassThru, self.s.symmetric_difference, check_pass_thru()) self.assertRaises(TypeError, self.s.symmetric_difference, [[]]) - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: self.assertEqual(self.thetype('abcba').symmetric_difference(C('cdc')), set('abd')) self.assertEqual(self.thetype('abcba').symmetric_difference(C('efgfe')), set('abcefg')) self.assertEqual(self.thetype('abcba').symmetric_difference(C('ccb')), set('a')) @@ -390,7 +390,7 @@ class TestSet(TestJointOps): self.assertRaises(PassThru, self.s.update, check_pass_thru()) self.assertRaises(TypeError, self.s.update, [[]]) for p, q in (('cdc', 'abcd'), ('efgfe', 'abcefg'), ('ccb', 'abc'), ('ef', 'abcef')): - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: s = self.thetype('abcba') self.assertEqual(s.update(C(p)), None) self.assertEqual(s, set(q)) @@ -411,7 +411,7 @@ class TestSet(TestJointOps): self.assertRaises(PassThru, self.s.intersection_update, check_pass_thru()) self.assertRaises(TypeError, self.s.intersection_update, [[]]) for p, q in (('cdc', 'c'), ('efgfe', ''), ('ccb', 'bc'), ('ef', '')): - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: s = self.thetype('abcba') self.assertEqual(s.intersection_update(C(p)), None) self.assertEqual(s, set(q)) @@ -436,7 +436,7 @@ class TestSet(TestJointOps): self.assertRaises(TypeError, self.s.difference_update, [[]]) self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]]) for p, q in (('cdc', 'ab'), ('efgfe', 'abc'), ('ccb', 'a'), ('ef', 'abc')): - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: s = self.thetype('abcba') self.assertEqual(s.difference_update(C(p)), None) self.assertEqual(s, set(q)) @@ -460,7 +460,7 @@ class TestSet(TestJointOps): self.assertRaises(PassThru, self.s.symmetric_difference_update, check_pass_thru()) self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]]) for p, q in (('cdc', 'abd'), ('efgfe', 'abcefg'), ('ccb', 'a'), ('ef', 'abcef')): - for C in set, frozenset, dict.fromkeys, str, str, list, tuple: + for C in set, frozenset, dict.fromkeys, str, str8, list, tuple: s = self.thetype('abcba') self.assertEqual(s.symmetric_difference_update(C(p)), None) self.assertEqual(s, set(q)) |