diff -r 7255af1a1c50 Doc/library/functools.rst --- a/Doc/library/functools.rst Mon May 25 12:32:20 2015 +0300 +++ b/Doc/library/functools.rst Fri May 29 17:04:00 2015 -0400 @@ -176,7 +176,7 @@ def newfunc(*fargs, **fkeywords): newkeywords = keywords.copy() newkeywords.update(fkeywords) - return func(*(args + fargs), **newkeywords) + return func(*args, *fargs, **newkeywords) newfunc.func = func newfunc.args = args newfunc.keywords = keywords diff -r 7255af1a1c50 Doc/whatsnew/3.5.rst --- a/Doc/whatsnew/3.5.rst Mon May 25 12:32:20 2015 +0300 +++ b/Doc/whatsnew/3.5.rst Fri May 29 17:04:00 2015 -0400 @@ -69,6 +69,7 @@ New syntax features: +* :pep:`448`, additional unpacking generalizations. * :pep:`465`, a new matrix multiplication operator: ``a @ b``. * :pep:`492`, coroutines with async and await syntax. @@ -146,6 +147,35 @@ :pep:`492` -- Coroutines with async and await syntax +PEP 448 - Additional Unpacking Generalizations +-------------------------------------------------------------- + +This PEP proposes extended usages of the * iterable unpacking operator +and ** dictionary unpacking operators to allow unpacking in more positions, +an arbitrary number of times, and in additional circumstances. Specifically, +in function calls, in comprehensions and generator expressions, and in +displays. + + >>> print(*[1], *[2], 3) + 1 2 3 + >>> dict(**{'x': 1}, y=2, **{'z': 3}) + {'x': 1, 'y': 2, 'z': 3} + >>> *range(4), 4 + (0, 1, 2, 3, 4) + >>> [*range(4), 4] + [0, 1, 2, 3, 4] + >>> {*range(4), 4} + {0, 1, 2, 3, 4} + >>> {'x': 1, **{'y': 2}} + {'x': 1, 'y': 2} + >>> {'x': 1, **{'x': 2}} + {'x': 2} + >>> {**{'x': 2}, 'x': 1} + {'x': 1} + +.. seealso:: + + :pep:`448` -- Additional Unpacking Generalizations PEP 461 - Adding formatting to bytes and bytearray --------------------------------------------------