mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #14288: Serialization support for builtin iterators.
This commit is contained in:
parent
283b96b6bd
commit
31668b8f7a
28 changed files with 2190 additions and 104 deletions
|
@ -4,6 +4,7 @@ Tests common to tuple, list and UserList.UserList
|
|||
|
||||
import unittest
|
||||
import sys
|
||||
import pickle
|
||||
|
||||
# Various iterables
|
||||
# This is used for checking the constructor (here and in test_deque.py)
|
||||
|
@ -388,3 +389,9 @@ class CommonTest(unittest.TestCase):
|
|||
self.assertEqual(a.index(0, -4*sys.maxsize, 4*sys.maxsize), 2)
|
||||
self.assertRaises(ValueError, a.index, 0, 4*sys.maxsize,-4*sys.maxsize)
|
||||
self.assertRaises(ValueError, a.index, 2, 0, -10)
|
||||
|
||||
def test_pickle(self):
|
||||
lst = self.type2test([4, 5, 6, 7])
|
||||
lst2 = pickle.loads(pickle.dumps(lst))
|
||||
self.assertEqual(lst2, lst)
|
||||
self.assertNotEqual(id(lst2), id(lst))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue