[Python-ideas] Pre-PEP: adding a statistics module to Python
Ethan Furman
ethan at stoneleaf.us
Sun Aug 4 17:20:58 CEST 2013
On 08/04/2013 05:51 AM, Eli Bendersky wrote:
> On Sun, Aug 4, 2013 at 12:07 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
>
> 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.
Fair point.
> 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".
Sounds useful.
>> 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'?
It's an absolutely fair comparison. Different modules, same name. Their functionalities? No, I don't immediately come
up with the differences, unless "gzip.open must have something to do with gzip files" counts. Coincidentally, that's
the same difference I immediately come up with for sum and statistics.sum -- "statistics.sum must have something do to
with statistics"; and I would never think about it again unless I had a problem with statistics.
> I definitely struggle with the latter. That may be because I'm
> average, of course.
Why should you have to be able to? 1) That's why we have documentation. 2) If you are summing objects of type xyz why
would you reach for something called statistics.sum?
> [Sorry to have beaten on this average thing so much; patronization
> drives me mad]
No offense intended. I definitely count myself in the "average" camp when it comes to statistics.
--
~Ethan~
More information about the Python-ideas
mailing list