[Python-ideas] Pre-PEP: adding a statistics module to Python
Brandon W Maister
bwmaister at gmail.com
Wed Aug 7 21:22:33 CEST 2013
> Andrew Barnert <abarnert at yahoo.com> wrote:
>>
>> But the point is that str.join doesn't use a one-pass algorithm, it just
>> constructs a list so it can do it in two passes. And it's been suggested on
>> this thread that variance could easily do the same thing.
>>
>> .. snip
>>
>> I think you still may be right that the error is the way to go. You'll
>> learn the problem quickly, and the workaround will be obvious, and the
>> reason for it will be available in the docs. The other two potential
>> surprises may not be as discoverable.
>>
>
I agree that the error is the way to go, but what about `variance(iterable,
one_pass=True)` defaulting to False, with an exception that says "Warning:
passing an iterable and using the one pass algorithm can lead to a slight
loss in accuracy" if an iterable is passed in?
Normally the stdlib accepts iterables anywhere a concrete collection works,
but normally also passing in an iterable doesn't change the semantics of a
function.
brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130807/69a4c4b9/attachment.html>
More information about the Python-ideas
mailing list