[Python-ideas] Fast sum() for non-numbers - why so much worries?

Andrew Barnert abarnert at yahoo.com
Thu Jul 11 00:11:28 CEST 2013


On Jul 10, 2013, at 15:02, Joshua Landau <joshua at landau.ws> wrote:

> On 10 July 2013 22:52, Ethan Furman <ethan at stoneleaf.us> wrote:
>> On 07/10/2013 02:36 PM, Joshua Landau wrote:
>>> 
>>> On 10 July 2013 22:03, Ethan Furman <ethan at stoneleaf.us> wrote:
>>>> 
>>>> On 07/10/2013 01:45 PM, Joshua Landau wrote:
>>>>> If Sergey doesn't do this separation, would it be fine if I did it? I
>>>>> like the idea for __iadd__ sum, and I don't want Sergey block progress
>>>>> on the issue.
>>>> 
>>>> 
>>>> 
>>>> Make a patch and add it to the tracker.
>>> 
>>> 
>>> Actually, there is already a bug on the tracker at
>>> http://bugs.python.org/issue18305 and the response was "discuss it on
>>> Python-Ideas".
>>> 
>>> Hence, I want to discuss it on Python ideas. So should I spawn it off
>>> onto a seperate thread about *just* the __iadd__ enhancement?
>> 
>> 
>> A separate thread on Python Ideas is probably appropriate, but you can add
>> your __iadd__ only patch to that issue.  I would think it would have a
>> better chance of acceptance since it would be a smaller change.
> 
> A cursory glance yields that that is the original patch.

Exactly. I believe Sergey's first patch already gets the __iadd__ thing exactly right.

Of course it's worth reviewing the patch, and testing it, and writing a pure Python version that other implementations can use, and discussing whether there should be any doc changes, and finding cases that are clearly summing number-like things that benefit (seriously, why has nobody who's +1 on this done the simple test with numpy.matrix yet?) so nobody can complain that it's useless, ... But you don't need to write C to do any of that.



More information about the Python-ideas mailing list