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
019a97c7
Commit
019a97c7
authored
Apr 19, 2011
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 11875: Keep OrderedDict's __reduce__ from temporarily mutating the object.
parent
c15d9e75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Lib/collections.py
Lib/collections.py
+2
-3
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/collections.py
View file @
019a97c7
...
...
@@ -154,10 +154,9 @@ class OrderedDict(dict):
def
__reduce__
(
self
):
'Return state information for pickling'
items
=
[[
k
,
self
[
k
]]
for
k
in
self
]
tmp
=
self
.
__map
,
self
.
__root
,
self
.
__hardroot
del
self
.
__map
,
self
.
__root
,
self
.
__hardroot
inst_dict
=
vars
(
self
).
copy
()
self
.
__map
,
self
.
__root
,
self
.
__hardroot
=
tmp
for
k
in
vars
(
self
.
__class__
()):
inst_dict
.
pop
(
k
,
None
)
if
inst_dict
:
return
(
self
.
__class__
,
(
items
,),
inst_dict
)
return
self
.
__class__
,
(
items
,)
...
...
Misc/NEWS
View file @
019a97c7
...
...
@@ -62,6 +62,9 @@ Library
-
Issue
#
11852
:
Add
missing
imports
and
update
tests
.
-
Issue
#
11875
:
collections
.
OrderedDict
's __reduce__ was temporarily
mutating the object instead of just working on a copy.
- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
specific part only digits. Patch by Santoso Wijaya.
...
...
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