diff options
author | Brandt Bucher <brandtbucher@gmail.com> | 2020-02-01 11:08:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-01 11:08:34 (GMT) |
commit | abb9a448dee3e18c69080231fbeba980bf048211 (patch) | |
tree | e95970aaf1c048045b8faedc114810263c36c541 /Python | |
parent | 4d96b4635aeff1b8ad41d41422ce808ce0b971c8 (diff) | |
download | cpython-abb9a448dee3e18c69080231fbeba980bf048211.zip cpython-abb9a448dee3e18c69080231fbeba980bf048211.tar.gz cpython-abb9a448dee3e18c69080231fbeba980bf048211.tar.bz2 |
Update sum comment. (#18240)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 4f833c1..5818eb9 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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); |