On 12 October 2012 03:22, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve+comp.lang.python@pearwood.info" target="_blank">steve+comp.lang.python@pearwood.info</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, 10 Oct 2012 23:44:42 -0700, suzaku wrote:<br>
<br>
> I think if a programmer has used the built-in `random` module before, he<br>
> would expect a function with "sample" in its name to return a population<br>
> sequence.<br>
<br>
</div>I have used the random module for about fifteen years, and I still write<br>
random.sample when I need to use random.choice.<br>
<br>
In statistics, probability, and plain English, a sample can be a single<br>
item: that's why we can say "a sample" or "two samples".</blockquote><div><br></div><div>Because I have no soul, I'm going to have to correct you here. We can write "a multitude" or "several multitudes", but that doesn't mean a multitude can contain but one item. It's singular because we have <i>one collection</i>, not <i>one item</i>. That said, we can still have a sample <i>of one</i>. And <i>samples</i> of one.</div>
<div><br></div><div>*teehee*</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> If a function is to return scalar value instead of sequence, I would<br>
> expect it to be named "choice".<br>
<br>
</div>And I wouldn't. But what do I care? I'm never going to use the code<br>
you're talking about, so call it "sasquatch" if you like, it's no skin<br>
off my nose.<br></blockquote></div>