8000 Simplify partial() rough equivalent code (gh-124941) · python/cpython@7ecaf21 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ecaf21

Browse files
authored
Simplify partial() rough equivalent code (gh-124941)
1 parent 1f9025a commit 7ecaf21

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Doc/library/functools.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ The :mod:`functools` module defines the following functions:
347347

348348
def partial(func, /, *args, **keywords):
349349
def newfunc(*more_args, **more_keywords):
350-
keywords_union = {**keywords, **more_keywords}
351-
return func(*args, *more_args, **keywords_union)
350+
return func(*args, *more_args, **(keywords | more_keywords))
352351
newfunc.func = func
353352
newfunc.args = args
354353
newfunc.keywords = keywords

0 commit comments

Comments
 (0)
0