• Home
  • Raw
  • Download

Lines Matching refs:set

15             self.assertEqual(repr(self.set), self.repr)
18 self.assertEqual(len(self.set), self.length)
21 self.assertEqual(self.set, self.set)
24 self.assertEqual(self.set, self.dup)
27 self.assertEqual(self.set.copy(), self.dup)
30 result = self.set | self.set
34 result = self.set | empty_set
38 result = empty_set | self.set
42 result = self.set & self.set
46 result = self.set & empty_set
50 result = empty_set & self.set
54 result = self.set ^ self.set
58 result = self.set ^ empty_set
59 self.assertEqual(result, self.set)
62 result = self.set - self.set
66 result = self.set - empty_set
70 result = empty_set - self.set
74 for v in self.set:
79 p = pickle.dumps(self.set, proto)
81 self.assertEqual(self.set, copy,
82 "%s != %s" % (self.set, copy))
90 self.set = Set(self.values)
101 self.set = Set(self.values)
107 self.assertTrue(3 in self.set)
110 self.assertTrue(2 not in self.set)
118 self.set = Set(self.values)
124 self.assertTrue((0, "zero") in self.set)
127 self.assertTrue(9 not in self.set)
135 self.set = Set(self.values)
181 self.set = Set((2, 4, 6))
184 self.assertEqual(self.set, Set({2:1,4:3,6:5}))
187 result = self.set | Set([2])
191 result = self.set | Set([2, 4, 6, 8])
195 result = self.set | Set([3, 4, 5])
199 result = self.set | Set([8])
203 result = self.set & Set((2, 4))
207 result = self.set & Set([2, 4, 6, 8])
211 result = self.set & Set([3, 4, 5])
215 result = self.set & Set([8])
219 result = self.set ^ Set((2, 4))
223 result = self.set ^ Set((2, 4, 6, 8))
227 result = self.set ^ Set((3, 4, 5))
231 result = self.set ^ Set([8])
248 t = self.set.copy()
250 self.assertEqual(t, self.set)
252 self.assertEqual(t, self.set)
255 t = self.set.copy()
264 self.set = Set((2, 4, 6))
267 self.set |= Set([2])
268 self.assertEqual(self.set, Set((2, 4, 6)))
271 self.set |= Set([2, 4, 6, 8])
272 self.assertEqual(self.set, Set([2, 4, 6, 8]))
275 self.set |= Set([3, 4, 5])
276 self.assertEqual(self.set, Set([2, 3, 4, 5, 6]))
279 self.set |= Set([8])
280 self.assertEqual(self.set, Set([2, 4, 6, 8]))
283 self.set.union_update(Set([3, 4, 5]))
284 self.assertEqual(self.set, Set([2, 3, 4, 5, 6]))
287 self.set &= Set((2, 4))
288 self.assertEqual(self.set, Set((2, 4)))
291 self.set &= Set([2, 4, 6, 8])
292 self.assertEqual(self.set, Set([2, 4, 6]))
295 self.set &= Set([3, 4, 5])
296 self.assertEqual(self.set, Set([4]))
299 self.set &= Set([8])
300 self.assertEqual(self.set, empty_set)
303 self.set.intersection_update(Set([3, 4, 5]))
304 self.assertEqual(self.set, Set([4]))
307 self.set ^= Set((2, 4))
308 self.assertEqual(self.set, Set([6]))
311 self.set ^= Set((2, 4, 6, 8))
312 self.assertEqual(self.set, Set([8]))
315 self.set ^= Set((3, 4, 5))
316 self.assertEqual(self.set, Set([2, 3, 5, 6]))
319 self.set ^= Set([8])
320 self.assertEqual(self.set, Set([2, 4, 6, 8]))
323 self.set.symmetric_difference_update(Set([3, 4, 5]))
324 self.assertEqual(self.set, Set([2, 3, 5, 6]))
327 self.set -= Set((2, 4))
328 self.assertEqual(self.set, Set([6]))
331 self.set -= Set((2, 4, 6, 8))
332 self.assertEqual(self.set, Set([]))
335 self.set -= Set((3, 4, 5))
336 self.assertEqual(self.set, Set([2, 6]))
339 self.set -= Set([8])
340 self.assertEqual(self.set, Set([2, 4, 6]))
343 self.set.difference_update(Set([3, 4, 5]))
344 self.assertEqual(self.set, Set([2, 6]))
351 self.set = Set(self.values)
354 self.set.add("c")
355 self.assertEqual(self.set, Set("abc"))
358 self.set.add("d")
359 self.assertEqual(self.set, Set("abcd"))
368 self.assertEqual(tmp, self.set)
371 self.set.remove("b")
372 self.assertEqual(self.set, Set("ac"))
376 self.set.remove("d")
382 expected_len = len(self.set)
384 self.set.remove(v)
386 self.assertEqual(len(self.set), expected_len)
389 self.set.discard("c")
390 self.assertEqual(self.set, Set("ab"))
393 self.set.discard("d")
394 self.assertEqual(self.set, Set("abc"))
397 self.set.clear()
398 self.assertEqual(len(self.set), 0)
402 while self.set:
403 popped[self.set.pop()] = None
409 self.set.union_update(())
410 self.assertEqual(self.set, Set(self.values))
413 self.set.union_update(("a",))
414 self.assertEqual(self.set, Set(self.values))
417 self.set.union_update(("a", "z"))
418 self.assertEqual(self.set, Set(self.values + ["z"]))
504 self.assertEqual(self.other == self.set, False)
505 self.assertEqual(self.set == self.other, False)
506 self.assertEqual(self.other != self.set, True)
507 self.assertEqual(self.set != self.other, True)
510 self.assertRaises(TypeError, lambda: self.set < self.other)
511 self.assertRaises(TypeError, lambda: self.set <= self.other)
512 self.assertRaises(TypeError, lambda: self.set > self.other)
513 self.assertRaises(TypeError, lambda: self.set >= self.other)
515 self.assertRaises(TypeError, lambda: self.other < self.set)
516 self.assertRaises(TypeError, lambda: self.other <= self.set)
517 self.assertRaises(TypeError, lambda: self.other > self.set)
518 self.assertRaises(TypeError, lambda: self.other >= self.set)
522 self.set |= self.other
530 self.set.union_update(self.other)
532 self.assertRaises(TypeError, self.set.union_update, self.other)
535 self.assertRaises(TypeError, lambda: self.set | self.other)
536 self.assertRaises(TypeError, lambda: self.other | self.set)
538 self.set.union(self.other)
540 self.assertRaises(TypeError, self.set.union, self.other)
544 self.set &= self.other
552 self.set.intersection_update(self.other)
555 self.set.intersection_update,
559 self.assertRaises(TypeError, lambda: self.set & self.other)
560 self.assertRaises(TypeError, lambda: self.other & self.set)
562 self.set.intersection(self.other)
564 self.assertRaises(TypeError, self.set.intersection, self.other)
568 self.set ^= self.other
576 self.set.symmetric_difference_update(self.other)
579 self.set.symmetric_difference_update,
583 self.assertRaises(TypeError, lambda: self.set ^ self.other)
584 self.assertRaises(TypeError, lambda: self.other ^ self.set)
586 self.set.symmetric_difference(self.other)
588 self.assertRaises(TypeError, self.set.symmetric_difference, self.other)
592 self.set -= self.other
600 self.set.difference_update(self.other)
603 self.set.difference_update,
607 self.assertRaises(TypeError, lambda: self.set - self.other)
608 self.assertRaises(TypeError, lambda: self.other - self.set)
610 self.set.difference(self.other)
612 self.assertRaises(TypeError, self.set.difference, self.other)
618 self.set = Set((1, 2, 3))
626 self.set = Set((1, 2, 3))
634 self.set = Set((1, 2, 3))
646 self.set = Set((1, 2, 3))
654 self.set = Set((1, 2, 3))
665 self.set = Set((1, 2, 3))
673 self.set = Set((1, 2, 3))
682 dup = self.set.copy()
683 self.assertEqual(len(dup), len(self.set))
685 set_list = sorted(self.set)
691 dup = copy.deepcopy(self.set)
692 self.assertSetEqual(dup, self.set)
698 self.set = Set()
704 self.set = Set(["hello"])
710 self.set = Set(["zero", 0, None])
720 self.set = Set([(1, 2)])
726 self.set = Set([((1, 2), (3, 4))])