restriction on sum: intentional bug?

Mark Dickinson dickinsm at gmail.com
Sun Oct 18 00:00:25 CEST 2009


On Oct 17, 9:49 pm, a... at pythoncraft.com (Aahz) wrote:
> Ahhh, I vaguely remember there being some discussion of this when sum()
> was introduced -- I think that using InPlaceAdd would have caused bad
> behavior when the initial list was referred to by multiple names.

Thanks for the pointer: I've now found the thread.  It looks like
Alex Martelli made this exact change 6 years ago, and then had to
revert it because it changed behaviour:

http://mail.python.org/pipermail/python-dev/2003-October/039511.html

I've just checked in an extra test to test_builtin.py to make sure
this bright idea isn't repeated. :)

--
Mark



More information about the Python-list mailing list