Unverified Kaydet (Commit) 05f91a42 authored tarafından Nick Coghlan's avatar Nick Coghlan Kaydeden (comit) GitHub

[3.6] Revert "bpo-32690: Preserve order of locals() (GH-5379) (#5390)"

This reverts commit 9105879b
in order to keep the behaviour of locals() consistent between
3.6.4 and 3.6.5+.
üst 04f99ba9
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, ...@@ -776,7 +776,7 @@ map_to_dict(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
assert(PyTuple_Check(map)); assert(PyTuple_Check(map));
assert(PyDict_Check(dict)); assert(PyDict_Check(dict));
assert(PyTuple_Size(map) >= nmap); assert(PyTuple_Size(map) >= nmap);
for (j=0; j < nmap; j++) { for (j = nmap; --j >= 0; ) {
PyObject *key = PyTuple_GET_ITEM(map, j); PyObject *key = PyTuple_GET_ITEM(map, j);
PyObject *value = values[j]; PyObject *value = values[j];
assert(PyUnicode_Check(key)); assert(PyUnicode_Check(key));
...@@ -829,7 +829,7 @@ dict_to_map(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values, ...@@ -829,7 +829,7 @@ dict_to_map(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
assert(PyTuple_Check(map)); assert(PyTuple_Check(map));
assert(PyDict_Check(dict)); assert(PyDict_Check(dict));
assert(PyTuple_Size(map) >= nmap); assert(PyTuple_Size(map) >= nmap);
for (j=0; j < nmap; j++) { for (j = nmap; --j >= 0; ) {
PyObject *key = PyTuple_GET_ITEM(map, j); PyObject *key = PyTuple_GET_ITEM(map, j);
PyObject *value = PyObject_GetItem(dict, key); PyObject *value = PyObject_GetItem(dict, key);
assert(PyUnicode_Check(key)); assert(PyUnicode_Check(key));
......
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