Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b98dcc1f
Commit
b98dcc1f
authored
May 03, 2013
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15535: Fix pickling of named tuples.
parent
8e596a76
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
0 deletions
+9
-0
Lib/collections/__init__.py
Lib/collections/__init__.py
+4
-0
Lib/test/test_collections.py
Lib/test/test_collections.py
+1
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/collections/__init__.py
View file @
b98dcc1f
...
...
@@ -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}
'''
...
...
Lib/test/test_collections.py
View file @
b98dcc1f
...
...
@@ -273,6 +273,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
)
...
...
Misc/ACKS
View file @
b98dcc1f
...
...
@@ -811,6 +811,7 @@ Trent Mick
Jason Michalski
Franck Michea
Tom Middleton
Thomas Miedema
Stan Mihai
Stefan Mihaila
Aristotelis Mikropoulos
...
...
Misc/NEWS
View file @
b98dcc1f
...
...
@@ -47,6 +47,9 @@ Library
- Issue #17802: Fix an UnboundLocalError in html.parser. Initial tests by
Thomas Barlow.
- Issue #15535: Fix namedtuple pickles which were picking up the OrderedDict
instead of just the underlying tuple.
- Issue #17192: Restore the patch for Issue #11729 which was ommitted in
3.3.1 when updating the bundled version of libffi used by ctypes. Update
many libffi files that were missed in 3.3.1'
s
update
to
libffi
-
3.0.13
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment