Author steven.daprano
Recipients mark.dickinson, rhettinger, steven.daprano
Date 2018-05-14.11:36:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
As mentioned on the Python-List:

random.choices() silently returns the wrong values when cumulative weights are not given, i.e. if the user misreads the documentation and provides non-cumulative weights, expecting that cumulative weights will be constructed for them.

I think that the documentation should be more clear, and preferably the choices() function ought to fail early when given invalid weights.
Date User Action Args
2018-05-14 11:36:38steven.dapranosetrecipients: + steven.daprano, rhettinger, mark.dickinson
2018-05-14 11:36:38steven.dapranosetmessageid: <>
2018-05-14 11:36:38steven.dapranolinkissue33494 messages
2018-05-14 11:36:38steven.dapranocreate