mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
cPickle produces NEWOBJ appropriately now. It still doesn't know
how to unpickle the new slot-full state tuples.
This commit is contained in:
parent
9cac1c4574
commit
71fcda5ba7
2 changed files with 204 additions and 78 deletions
|
@ -718,12 +718,6 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
else:
|
||||
self.failUnless(num_setitems >= 2)
|
||||
|
||||
# XXX Temporary hack, so long as the C implementation of pickle protocol
|
||||
# XXX 2 isn't ready. When it is, move the methods in TempAbstractPickleTests
|
||||
# XXX into AbstractPickleTests above, and get rid of TempAbstractPickleTests
|
||||
# XXX along with the references to it in test_pickle.py.
|
||||
class TempAbstractPickleTests(unittest.TestCase):
|
||||
|
||||
def test_simple_newobj(self):
|
||||
x = object.__new__(SimpleNewObj) # avoid __init__
|
||||
x.abc = 666
|
||||
|
@ -734,6 +728,12 @@ class TempAbstractPickleTests(unittest.TestCase):
|
|||
self.assertEqual(y.abc, 666)
|
||||
self.assertEqual(x.__dict__, y.__dict__)
|
||||
|
||||
# XXX Temporary hack, so long as the C implementation of pickle protocol
|
||||
# XXX 2 isn't ready. When it is, move the methods in TempAbstractPickleTests
|
||||
# XXX into AbstractPickleTests above, and get rid of TempAbstractPickleTests
|
||||
# XXX along with the references to it in test_pickle.py.
|
||||
class TempAbstractPickleTests(unittest.TestCase):
|
||||
|
||||
def test_newobj_list_slots(self):
|
||||
x = SlotList([1, 2, 3])
|
||||
x.foo = 42
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue