This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <1526297798.91.0.682650639539.issue33494@psf.upfronthosting.co.za>
In-reply-to
Content
As mentioned on the Python-List:

https://mail.python.org/pipermail/python-list/2018-May/733061.html

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.
History
Date User Action Args
2018-05-14 11:36:38steven.dapranosetrecipients: + steven.daprano, rhettinger, mark.dickinson
2018-05-14 11:36:38steven.dapranosetmessageid: <1526297798.91.0.682650639539.issue33494@psf.upfronthosting.co.za>
2018-05-14 11:36:38steven.dapranolinkissue33494 messages
2018-05-14 11:36:38steven.dapranocreate