def test_iterator_pickling(self):
        testcases = [(13,), (0, 11), (-22, 10), (20, 3, -1),
                     (13, 21, 3), (-2, 2, 2), (2**65, 2**65+2)]
        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
            for t in testcases:
                it = itorg = iter(range(*t))
                data = list(range(*t))

                d = pickle.dumps(it)
                it = pickle.loads(d)
                self.assertEqual(type(itorg), type(it))
                self.assertEqual(list(it), data)

                it = pickle.loads(d)
                try:
                    next(it)
                except __HOLE__:
                    continue
                d = pickle.dumps(it)
                it = pickle.loads(d)
                self.assertEqual(list(it), data[1:])
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_range.py/RangeTest.test_iterator_pickling