[New-bugs-announce] [issue18844] allow weights in random.choice

Alan Isaac report at bugs.python.org
Mon Aug 26 19:23:45 CEST 2013

New submission from Alan Isaac:

The need for weighted random choices is so common that it is addressed as a "common task" in the docs:

This enhancement request is to add an optional argument to random.choice, which must be a sequence of non-negative numbers (the weights) having the same length as the main argument.

messages: 196229
nosy: aisaac
priority: normal
severity: normal
status: open
title: allow weights in random.choice
type: enhancement

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list