[Python-ideas] Pre-PEP: adding a statistics module to Python
Eli Bendersky
eliben at gmail.com
Sun Aug 4 14:51:45 CEST 2013
On Sun, Aug 4, 2013 at 12:07 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 08/03/2013 07:00 PM, Eli Bendersky wrote:
>>
>>
>> While I'm somewhat -0.5 on the general idea of the statistics module
>> (competing with well-established, super-optimized and
>> by-themselves-famous numeric libraries Python has does not sound like
>> a worthy goal),
>
>
> Sure, competing with already established libraries is silly. Fortunately,
> that's not what is happening here. This PEP is about providing a minimal,
> common set of statistics functions for the average person.
I'm really not sure who this average person is, but everyone keeps
talking about him. Is it the same person for whom Dummies books are
written?
Anyhow, "minimal" is a dangerous slope. With such a module in the
stdlib, I'm 100% sure we'll get a constant stream of - please add just
this function (from SciPy) - it's so useful to the "average person" -
requests. This is unavoidable. And it will be difficult to judge at
that point why certain funcitonality belongs or does not belong here.
So over time we'll end up with a partial Greenspun, by containing an
ad hoc, slow implementation of half of Numpy/SciPy.
Efforts are better spent in writing a new tutorial on Numpy that shows
how to do the stuff statistics.py does. Call it "Numpy statistics for
the average person".
>> I have to agree with Alexander w.r.t. "sum". Strongly
>> -1 from me on having functions with the same name as existing stdlib
>> functions but different functionality. This is very much unpythonic.
>
>
> I thought the whole point of name spaces was to be able to have the same
> name mean different things in different contexts. Surely no one expects to
> be able to use `webbrowser.open` or `gzip.open` anywhere `open` can be used.
This is not a fair comparison. As a pop quiz, try to imagine the
difference between 'open' and 'gzip.open' - do you immediately come up
with the differences in their functionalities? Now, how about 'sum'
and 'statistics.sum'?
I definitely struggle with the latter. That may be because I'm
average, of course.
[Sorry to have beaten on this average thing so much; patronization
drives me mad]
Eli
More information about the Python-ideas
mailing list