cPickle produces NEWOBJ appropriately now. It still doesn't know

how to unpickle the new slot-full state tuples.
This commit is contained in:
Tim Peters 2003-02-14 23:05:28 +00:00
parent 9cac1c4574
commit 71fcda5ba7
2 changed files with 204 additions and 78 deletions

View file

@ -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