[Python-checkins] Use dict unpacking in functools.partial() docs (GH-9412)

Victor Stinner webhook-mailer at python.org
Fri Oct 19 17:42:12 EDT 2018

commit: b981fec8d63697e8265d016582ce84944f272d55
branch: master
author: Sergey Fedoseev <fedoseev.sergey at gmail.com>
committer: Victor Stinner <vstinner at redhat.com>
date: 2018-10-19T23:42:07+02:00

Use dict unpacking in functools.partial() docs (GH-9412)

M Doc/library/functools.rst

diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 7d59ec9187df..ec3d5a529e65 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -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

More information about the Python-checkins mailing list