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 <1378014222.58.0.103201321318.issue18844@psf.upfronthosting.co.za>
In-reply-to
Content
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().
History
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: <1378014222.58.0.103201321318.issue18844@psf.upfronthosting.co.za>
2013-09-01 05:43:42rhettingerlinkissue18844 messages
2013-09-01 05:43:42rhettingercreate