mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
merge 3.5 (#24569)
This commit is contained in:
commit
9f71cb0fee
3 changed files with 26 additions and 6 deletions
|
|
@ -128,6 +128,9 @@ Dict display element unpacking
|
||||||
... for i in range(1000)) + "}"))
|
... for i in range(1000)) + "}"))
|
||||||
1000
|
1000
|
||||||
|
|
||||||
|
>>> {0:1, **{0:2}, 0:3, 0:4}
|
||||||
|
{0: 4}
|
||||||
|
|
||||||
List comprehension element unpacking
|
List comprehension element unpacking
|
||||||
|
|
||||||
>>> a, b, c = [0, 1, 2], 3, 4
|
>>> a, b, c = [0, 1, 2], 3, 4
|
||||||
|
|
|
||||||
14
Misc/NEWS
14
Misc/NEWS
|
|
@ -18,6 +18,20 @@ Library
|
||||||
now can't be disabled at compile time.
|
now can't be disabled at compile time.
|
||||||
|
|
||||||
|
|
||||||
|
What's New in Python 3.5.0 beta 4?
|
||||||
|
==================================
|
||||||
|
|
||||||
|
*Release date: XXXX-XX-XX*
|
||||||
|
|
||||||
|
Core and Builtins
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
- Issue #24569: Make PEP 448 dictionary evaluation more consistent.
|
||||||
|
|
||||||
|
Library
|
||||||
|
-------
|
||||||
|
|
||||||
|
|
||||||
What's New in Python 3.5.0 beta 3?
|
What's New in Python 3.5.0 beta 3?
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2561,22 +2561,25 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
}
|
}
|
||||||
|
|
||||||
TARGET(BUILD_MAP) {
|
TARGET(BUILD_MAP) {
|
||||||
|
int i;
|
||||||
PyObject *map = _PyDict_NewPresized((Py_ssize_t)oparg);
|
PyObject *map = _PyDict_NewPresized((Py_ssize_t)oparg);
|
||||||
if (map == NULL)
|
if (map == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
while (--oparg >= 0) {
|
for (i = oparg; i > 0; i--) {
|
||||||
int err;
|
int err;
|
||||||
PyObject *value = TOP();
|
PyObject *key = PEEK(2*i);
|
||||||
PyObject *key = SECOND();
|
PyObject *value = PEEK(2*i - 1);
|
||||||
STACKADJ(-2);
|
|
||||||
err = PyDict_SetItem(map, key, value);
|
err = PyDict_SetItem(map, key, value);
|
||||||
Py_DECREF(value);
|
|
||||||
Py_DECREF(key);
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
Py_DECREF(map);
|
Py_DECREF(map);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (oparg--) {
|
||||||
|
Py_DECREF(POP());
|
||||||
|
Py_DECREF(POP());
|
||||||
|
}
|
||||||
PUSH(map);
|
PUSH(map);
|
||||||
DISPATCH();
|
DISPATCH();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue