https://github.com/python/cpython/commit/7ecaf21946a1da0ede664447839537a7fc5eb64e
commit: 7ecaf21946a1da0ede664447839537a7fc5eb64e
branch: main
author: Raymond Hettinger <[email protected]>
committer: rhettinger <[email protected]>
date: 2024-10-03T19:54:53Z
summary:

Simplify partial() rough equivalent code (gh-124941)

files:
M Doc/library/functools.rst

diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 46136def06dc05..e26a2226aa947a 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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to