Skip to content

Commit

Permalink
Use dict unpacking in functools.partial() docs (pythonGH-9412)
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-sigurd authored and vstinner committed Oct 19, 2018
1 parent 3bd0d62 commit b981fec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ The :mod:`functools` module defines the following functions:

def partial(func, *args, **keywords):
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update(fkeywords)
newkeywords = {**keywords, **fkeywords}
return func(*args, *fargs, **newkeywords)
newfunc.func = func
newfunc.args = args
Expand Down

0 comments on commit b981fec

Please sign in to comment.