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
a4d00012
Commit
a4d00012
authored
Jan 28, 2018
by
Raymond Hettinger
Committed by
GitHub
Jan 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-32690: Preserve order of locals() (#5379)
parent
059f58ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Misc/NEWS.d/next/Core and Builtins/2018-01-28-09-26-07.bpo-32690.8i9g5P.rst
...ore and Builtins/2018-01-28-09-26-07.bpo-32690.8i9g5P.rst
+2
-0
Objects/frameobject.c
Objects/frameobject.c
+2
-2
No files found.
Misc/NEWS.d/next/Core and Builtins/2018-01-28-09-26-07.bpo-32690.8i9g5P.rst
0 → 100644
View file @
a4d00012
The locals() dictionary now displays in the lexical order that variables
were defined. Previously, the order was reversed.
Objects/frameobject.c
View file @
a4d00012
...
...
@@ -791,7 +791,7 @@ map_to_dict(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
assert
(
PyTuple_Check
(
map
));
assert
(
PyDict_Check
(
dict
));
assert
(
PyTuple_Size
(
map
)
>=
nmap
);
for
(
j
=
nmap
;
--
j
>=
0
;
)
{
for
(
j
=
0
;
j
<
nmap
;
j
++
)
{
PyObject
*
key
=
PyTuple_GET_ITEM
(
map
,
j
);
PyObject
*
value
=
values
[
j
];
assert
(
PyUnicode_Check
(
key
));
...
...
@@ -844,7 +844,7 @@ dict_to_map(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
assert
(
PyTuple_Check
(
map
));
assert
(
PyDict_Check
(
dict
));
assert
(
PyTuple_Size
(
map
)
>=
nmap
);
for
(
j
=
nmap
;
--
j
>=
0
;
)
{
for
(
j
=
0
;
j
<
nmap
;
j
++
)
{
PyObject
*
key
=
PyTuple_GET_ITEM
(
map
,
j
);
PyObject
*
value
=
PyObject_GetItem
(
dict
,
key
);
assert
(
PyUnicode_Check
(
key
));
...
...
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