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 rhettinger
Recipients aisaac, madison.may, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, tim.peters
Date 2013-09-01.05:43:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The sticking point is going to be that we don't want to recompute the cumulative weights for every call to weighted_choice.

So there should probably be two functions:

  cw = make_cumulate_weights(weight_list) 
  x = choice(choice_list, cw)

This is similar to what was done with string.maketrans() and str.translate().
Date User Action Args
2013-09-01 05:43:42rhettingersetrecipients: + rhettinger, tim.peters, mark.dickinson, pitrou, aisaac, serhiy.storchaka, madison.may
2013-09-01 05:43:42rhettingersetmessageid: <>
2013-09-01 05:43:42rhettingerlinkissue18844 messages
2013-09-01 05:43:42rhettingercreate