On Wed, 10 Oct 2012 23:44:42 -0700, suzaku wrote:

> I think if a programmer has used the built-in `random` module before, he
> would expect a function with "sample" in its name to return a population
> sequence.

I have used the random module for about fifteen years, and I still write 
random.sample when I need to use random.choice.

In statistics, probability, and plain English, a sample can be a single 
item: that's why we can say "a sample" or "two samples".


> If a function is to return scalar value instead of sequence, I would
> expect it to be named "choice".

And I wouldn't. But what do I care? I'm never going to use the code 
you're talking about, so call it "sasquatch" if you like, it's no skin 
off my nose.

:)


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to