]> granicus.if.org Git - python/commitdiff
Use dict unpacking in functools.partial() docs (GH-9412)
authorSergey Fedoseev <fedoseev.sergey@gmail.com>
Fri, 19 Oct 2018 21:42:07 +0000 (02:42 +0500)
committerVictor Stinner <vstinner@redhat.com>
Fri, 19 Oct 2018 21:42:07 +0000 (23:42 +0200)
Doc/library/functools.rst

index 7d59ec9187df454b3ee970f821bf77df6d232c4b..ec3d5a529e658e47d7f34f173abbab4be8605dcb 100644 (file)
@@ -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