This commit is contained in:
Raymond Hettinger 2013-05-03 02:41:02 -07:00
commit 4072875dcb
3 changed files with 6 additions and 0 deletions

View file

@ -281,6 +281,10 @@ class {typename}(tuple):
'Return self as a plain tuple. Used by copy and pickle.'
return tuple(self)
def __getstate__(self):
'Exclude the OrderedDict from pickling'
return None
{field_defs}
'''

View file

@ -305,6 +305,7 @@ class TestNamedTuple(unittest.TestCase):
q = loads(dumps(p, protocol))
self.assertEqual(p, q)
self.assertEqual(p._fields, q._fields)
self.assertNotIn(b'OrderedDict', dumps(p, protocol))
def test_copy(self):
p = TestNT(x=10, y=20, z=30)

View file

@ -829,6 +829,7 @@ Trent Mick
Jason Michalski
Franck Michea
Tom Middleton
Thomas Miedema
Stan Mihai
Stefan Mihaila
Aristotelis Mikropoulos