mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Document why functools.partial() must copy kwargs (#253)
Add a comment to prevent further attempts to avoid a copy for optimization.
This commit is contained in:
parent
324c5d8ca6
commit
561ca80cff
2 changed files with 5 additions and 2 deletions
|
|
@ -163,6 +163,9 @@ partial_call(partialobject *pto, PyObject *args, PyObject *kw)
|
|||
Py_XINCREF(kwappl);
|
||||
}
|
||||
else {
|
||||
/* bpo-27840, bpo-29318: dictionary of keyword parameters must be
|
||||
copied, because a function using "**kwargs" can modify the
|
||||
dictionary. */
|
||||
kwappl = PyDict_Copy(pto->kw);
|
||||
if (kwappl == NULL) {
|
||||
Py_XDECREF(argappl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue