From: Raymond Hettinger Date: Thu, 3 Oct 2024 19:54:53 +0000 (-0500) Subject: Simplify partial() rough equivalent code (gh-124941) X-Git-Tag: v3.14.0a1~196 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ecaf21946a1da0ede664447839537a7fc5eb64e;p=thirdparty%2FPython%2Fcpython.git Simplify partial() rough equivalent code (gh-124941) --- diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 46136def06dc..e26a2226aa94 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