<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>On Aug 7, 2013, at 12:22, Brandon W Maister <<a href="mailto:bwmaister@gmail.com">bwmaister@gmail.com</a>> wrote:</div><div><br></div><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto"><div class="gmail_quote">
Andrew Barnert <<a href="mailto:abarnert@yahoo.com" target="_blank">abarnert@yahoo.com</a>> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="h5">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.<div>
<br></div><div>.. snip<br></div><br><div>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.<br></div></div></div></blockquote></div></div></div></blockquote><div><br><div>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?<br></div></div></div></div></div></div></blockquote><div><br></div><div>First, I think you meant "iterator" there, not "iterable". (A list is an iterable, but not an iterator.)</div><div><br></div><div>Second, I'd expect that onepass=True would lead to a loss in accuracy no matter what the other argument was.</div><div><br></div><div>Finally, if passing onepass=True causes it to raise an exception, why even have the option?</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><br></div>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.<br><br></div><div>brandon<br></div></div></div></div>
</div></blockquote></body></html>