restriction on sum: intentional bug?
aahz at pythoncraft.com
Sun Oct 18 00:34:14 CEST 2009
In article <a33fb576-f453-4936-8551-9b999b5e2927 at p35g2000yqh.googlegroups.com>,
Mark Dickinson <dickinsm at gmail.com> wrote:
>On Oct 17, 9:49=A0pm, 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:
>I've just checked in an extra test to test_builtin.py to make sure
>this bright idea isn't repeated. :)
Thanks! I hope you added a comment to the code, too. ;-)
And wow, sometimes my memory amazes me...
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"To me vi is Zen. To use vi is to practice zen. Every command is a
koan. Profound to the user, unintelligible to the uninitiated. You
discover truth everytime you use it." --reddy at lion.austin.ibm.com
More information about the Python-list