[Python-ideas] Intermediate Summary: Fast sum() for non-numbers

David Mertz mertz at gnosis.cx
Tue Jul 16 00:09:01 CEST 2013


On Mon, Jul 15, 2013 at 2:56 PM, Joshua Landau <joshua at landau.ws> wrote:

> > "Can you sum these lists? An acceptable answer would be that the question
> > does not make sense.  If it does make sense, what result do you get?"
>
> You should have asked "can you sum this list [note the singular noun]
> of lists?" or somesuch. Because that's odd linguistically, you can say
> instead "can you sum these lists together", although that's obviously
> a bit of a rigged statement. You're free to think of a better
> compromise.
>

I agree that the result is likely to depend a lot on the nuance of how it
is worded to a native speaker.

I just asked my friend--who is now, however, no longer experimentally
naive--what she would have said had I asked "Can you sum these lists
together?"  I feel like "Can you sum this list of lists?" would just sound
perverse to a non-programmer, although I agree that if they thought about
it slowly they'd be more likely to come up with concatenation (but I still
think most wouldn't do so).

Her answer was that she would have produced a single number that was the
total of all the numbers in all the lists (or equivalently, the sum of the
three map(sum, ...) items).  I didn't actually lay out the papers again or
make her perform the additions though :-).

Of course, we're still talking about one more data point really.  Although
I have intuitions, there are millions or billions of non-programmers or
aspiring programmers, and obviously answers would vary.

-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130715/4df9bb9c/attachment-0001.html>


More information about the Python-ideas mailing list