]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update sum comment. (#18240)
authorBrandt Bucher <brandtbucher@gmail.com>
Sat, 1 Feb 2020 11:08:34 +0000 (03:08 -0800)
committerGitHub <noreply@github.com>
Sat, 1 Feb 2020 11:08:34 +0000 (11:08 +0000)
Python/bltinmodule.c

index 4f833c1f462533055ab6c203ab1ff6a8568a2879..5818eb9e38f6ad50ca76969051e47220466f8e66 100644 (file)
@@ -2440,7 +2440,11 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
              empty = []
              sum([[x] for x in range(10)], empty)
 
-           would change the value of empty. */
+           would change the value of empty. In fact, using
+           in-place addition rather that binary addition for
+           any of the steps introduces subtle behavior changes:
+           
+           https://bugs.python.org/issue18305 */
         temp = PyNumber_Add(result, item);
         Py_DECREF(result);
         Py_DECREF(item);