Kaydet (Commit) 4072875d authored tarafından Raymond Hettinger's avatar Raymond Hettinger

merge

...@@ -281,6 +281,10 @@ class {typename}(tuple): ...@@ -281,6 +281,10 @@ class {typename}(tuple):
'Return self as a plain tuple. Used by copy and pickle.' 'Return self as a plain tuple. Used by copy and pickle.'
return tuple(self) return tuple(self)
def __getstate__(self):
'Exclude the OrderedDict from pickling'
return None
{field_defs} {field_defs}
''' '''
......
...@@ -305,6 +305,7 @@ class TestNamedTuple(unittest.TestCase): ...@@ -305,6 +305,7 @@ class TestNamedTuple(unittest.TestCase):
q = loads(dumps(p, protocol)) q = loads(dumps(p, protocol))
self.assertEqual(p, q) self.assertEqual(p, q)
self.assertEqual(p._fields, q._fields) self.assertEqual(p._fields, q._fields)
self.assertNotIn(b'OrderedDict', dumps(p, protocol))
def test_copy(self): def test_copy(self):
p = TestNT(x=10, y=20, z=30) p = TestNT(x=10, y=20, z=30)
......
...@@ -829,6 +829,7 @@ Trent Mick ...@@ -829,6 +829,7 @@ Trent Mick
Jason Michalski Jason Michalski
Franck Michea Franck Michea
Tom Middleton Tom Middleton
Thomas Miedema
Stan Mihai Stan Mihai
Stefan Mihaila Stefan Mihaila
Aristotelis Mikropoulos Aristotelis Mikropoulos
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment