Lines Matching refs:tuple

7 # For tuple hashes, we normally only run a test to ensure that we get
19 type2test = tuple
23 msg = "tuple indices must be integers or slices"
30 self.assertEqual(tuple(), ())
32 t0_3_bis = tuple(t0_3)
34 self.assertEqual(tuple([]), ())
35 self.assertEqual(tuple([0, 1, 2, 3]), (0, 1, 2, 3))
36 self.assertEqual(tuple(''), ())
37 self.assertEqual(tuple('spam'), ('s', 'p', 'a', 'm'))
38 self.assertEqual(tuple(x for x in range(10) if x % 2),
43 tuple(sequence=())
46 class subclass(tuple):
54 class subclass_with_init(tuple):
62 class subclass_with_new(tuple):
102 self.assertEqual(list(tuple(f())), list(range(1000)))
125 # Earlier versions of the tuple hash algorithm had massive collisions
135 # If specified, `expected` is a 2-tuple of expected
204 # there's nothing the tuple hash can do to avoid collisions
205 # inherited from collisions in the tuple components' hashes.
235 # random mean. Even if the tuple hash can't achieve that on its
238 # that the tuple hash doesn't systematically ruin that.
243 # The "old tuple test". See https://bugs.python.org/issue942952.
253 tryone("old tuple test", inps,
257 # The "new tuple test". See https://bugs.python.org/issue34751.
279 tryone("new tuple test", T,
283 l0 = tuple()
307 # Test GC-optimization of tuple literals
336 check(tp(tuple([obj]) for obj in [1, x, y]))
337 check(tuple(tp([obj]) for obj in [1, x, y]))
343 self._tracked(tp(tuple([obj]) for obj in [x, y, z]))
344 self._tracked(tuple(tp([obj]) for obj in [x, y, z]))
349 self.check_track_dynamic(tuple, False)
354 class MyTuple(tuple):
360 # Trying to untrack an unfinished tuple could crash Python
361 self._not_tracked(tuple(gc.collect() for i in range(101)))
407 class T(tuple): pass
441 # When global JUST_SHOW_HASH_RESULTS is True, the tuple hash statistics
444 # old tuple test; 32-bit upper hash codes; \
447 # "old tuple test" is just a string name for the test being run.
476 # old tuple test; 32-bit lower hash codes; \
498 # 1 extra. It's a relatively poor case for the tuple hash, but still