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

Sergey sergemp at mail.ru
Wed Jul 10 23:58:42 CEST 2013


On Jul 9, 2013 Ron Adam wrote:

>> Seriously, why there's so much holy wars about that? I'm not asking
>> to rewrite cpython on Java or C#. I'm not adding a bunch of new
>> functions, I'm not even changing signatures of existing functions.
> 
> It's the nature of this particular news group.  We focus on improving 
> python, and that includes new things and improving old things, but also 
> includes discussing any existing or potential problems.
> 
> You will almost always get a mix of approval and disapproval on just about 
> every thing here.  It's not a war, it's just different people having 
> different opinions.
> 
> Quite often that leads to finding better ways to do things, and in the long 
> run, helps avoid adding features and changes that could be counter 
> productive to python.

I must agree that I was indeed inspired with some new ideas during
this discussion. It's just that those "inspirations" come in a very
non-constructive form of "it makes no sense", "cannot always be fast",
"you can't", "everyone else thinks you shouldn't", etc.

Or is that a lifehack [1] in action? I.e. "You can't make it fast for
that type. Oh, you can? Then you can't make it fast for that type.
Oh, you did that too? But you can't make it fast for all the types!"
What if I can? ;)

It's just instead of discussing what is the best way to fix a slowness,
I'm spending most time trying to convince people that slowness should
be fixed.
— sum is slow for lists, let's fix that!
— you shouldn't use sum...
— why can't I use sum?
— because it's slow
— then let's fix that!
— you shouldn't use sum...
I haven't thought that somebody can truly believe that something should
be slow, and will find one excuse after another instead of just fixing
the slowness.

> If it only makes an existing function faster and doesn't change any other 
> behaviour, and all the tests still pass for it.  Just create an issue on 
> the tracker, with the patch posted there, and it will probably be accepted 
> after it goes through a much more focused review process.

I've done that first [2] And there I was asked to write here. :)

> But discussing it here will invite a lot of opinions about how it works, 
> how it shouldn't work, what would work better, and etc...

And about what *I* shouldn't do, what *I* can't and what *I* need.
As if I'm the bug that should be fixed. :(

> It's what this board if for.  ;-)

-- 
[1] http://bash.org/?152037
[2] http://bugs.python.org/issue18305


More information about the Python-ideas mailing list