[Python-ideas] random.boolean or bernoulli

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 22 02:24:34 CEST 2011


Robert Kern wrote:
> On 4/21/11 1:46 PM, Raymond Hettinger wrote:
> 
>> P.S. Bernoulli isn't even jargon;
> 
> Actually, it is the canonical name of a particular discrete probability 
> distribution. *If* one cared to add it, it would be a perfectly fine 
> name for it, though "bernoullivariate" might fit better with the other 
> named distributions.

The problem is that

  if bernoullivariate(0.5):
     do_something()

doesn't help to make the code any clearer to someone who
isn't steeped in statistical theory, whereas chance() has
a suggestive meaning to just about everyone.

-- 
Greg





More information about the Python-ideas mailing list