summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2024-10-03 19:54:53 (GMT)
committerGitHub <noreply@github.com>2024-10-03 19:54:53 (GMT)
commit7ecaf21946a1da0ede664447839537a7fc5eb64e (patch)
treece63117bac96f0b37156d168626a3b5869880415 /Doc
parent1f9025a4e7819bb4f7799784710f0f3750a9ca31 (diff)
downloadcpython-7ecaf21946a1da0ede664447839537a7fc5eb64e.zip
cpython-7ecaf21946a1da0ede664447839537a7fc5eb64e.tar.gz
cpython-7ecaf21946a1da0ede664447839537a7fc5eb64e.tar.bz2
Simplify partial() rough equivalent code (gh-124941)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functools.rst3
1 files changed, 1 insertions, 2 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 46136de..e26a222 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -347,8 +347,7 @@ The :mod:`functools` module defines the following functions:
def partial(func, /, *args, **keywords):
def newfunc(*more_args, **more_keywords):
- keywords_union = {**keywords, **more_keywords}
- return func(*args, *more_args, **keywords_union)
+ return func(*args, *more_args, **(keywords | more_keywords))
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords