mirror of
https://github.com/python/cpython.git
synced 2025-10-01 04:42:10 +00:00
[3.6] Revert "bpo-32690: Preserve order of locals() (GH-5379) (#5390)"
This reverts commit 9105879bfd
in order to keep the behaviour of locals() consistent between
3.6.4 and 3.6.5+.
This commit is contained in:
parent
04f99ba9d7
commit
05f91a42cd
2 changed files with 2 additions and 4 deletions
|
@ -1,2 +0,0 @@
|
|||
The locals() dictionary now displays in the lexical order that variables
|
||||
were defined. Previously, the order was reversed.
|
|
@ -776,7 +776,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=0; j < nmap; j++) {
|
||||
for (j = nmap; --j >= 0; ) {
|
||||
PyObject *key = PyTuple_GET_ITEM(map, j);
|
||||
PyObject *value = values[j];
|
||||
assert(PyUnicode_Check(key));
|
||||
|
@ -829,7 +829,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=0; j < nmap; j++) {
|
||||
for (j = nmap; --j >= 0; ) {
|
||||
PyObject *key = PyTuple_GET_ITEM(map, j);
|
||||
PyObject *value = PyObject_GetItem(dict, key);
|
||||
assert(PyUnicode_Check(key));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue