Message316499
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. |
|
Date |
User |
Action |
Args |
2018-05-14 11:36:38 | steven.daprano | set | recipients:
+ steven.daprano, rhettinger, mark.dickinson |
2018-05-14 11:36:38 | steven.daprano | set | messageid: <1526297798.91.0.682650639539.issue33494@psf.upfronthosting.co.za> |
2018-05-14 11:36:38 | steven.daprano | link | issue33494 messages |
2018-05-14 11:36:38 | steven.daprano | create | |
|