Message262981
> One to make it return a single number if amount == 1 and the other to check that the amount > 1.
I think that's a dangerous API. Any code making a call to "weighted_choice(..., amount=n)" for variable n now has to be prepared to deal with two possible result types. It would be easy to introduce buggy code that fails in the corner case n = 1. |
|
Date |
User |
Action |
Args |
2016-04-07 07:21:09 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, pitrou, aisaac, westley.martinez, serhiy.storchaka, NeilGirdhar, madison.may, dkorchem, Christian.Kleineidam, xksteven |
2016-04-07 07:21:09 | mark.dickinson | set | messageid: <1460013669.64.0.566648461725.issue18844@psf.upfronthosting.co.za> |
2016-04-07 07:21:09 | mark.dickinson | link | issue18844 messages |
2016-04-07 07:21:09 | mark.dickinson | create | |
|