[Python-ideas] statistics.sum [was Re: Pre-PEP: adding a statistics module to Python]

Nick Coghlan ncoghlan at gmail.com
Tue Aug 6 01:46:47 CEST 2013


On 6 Aug 2013 08:43, "Joshua Landau" <joshua at landau.ws> wrote:
>
> On 5 August 2013 21:04, Steven D'Aprano <steve at pearwood.info> wrote:
>>
>> Thanks to everyone who has given feedback, it has been very humbling and
informative. I have a revised proto-PEP just about ready for (hopefully
final) feedback, but before I do there is one potentially major stumbling
block: whether or not the statistics module should have it's own version of
sum.
>
> ...
>>
>> Are there still objections to making statistics.sum public? If the only
way to move forward is to make it a private implementation detail, I will
do so, but I really think that I have built a better sum and hope to keep
it as a public function.
>>
>> Show of hands please, +1 or -1 on statistics.sum.
>
>
>  +1 for any of [math.]statistics.[[precise]_]sum or equiv.

+1 from me, too. "Ducktyping" in the case of the statistics module refers
to something being a Real number (in the mathematical sense). Doing this
kind of basic statistical analysis with complex numbers or containers that
happen to implement a "+" operation doesn't make sense.

(Note: one advantage of calling the new module math.statistics is that it
leaves the door open to a possible future cmath.statistics, since there
*are* some statistical operations that make sense with complex numbers, too)

Cheers,
Nick.

>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130806/ecf6072b/attachment.html>


More information about the Python-ideas mailing list