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 madison.may
Recipients aisaac, madison.may, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, tim.peters, westley.martinez
Date 2013-09-01.14:37:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1378046224.47.0.370545684575.issue18844@psf.upfronthosting.co.za>
In-reply-to
Content
[Raymond Hettinger]
> 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)

That's pretty much how I broke things up when I decided to test out optimization with lru_cache.  That version of the patch is now attached.

[Serhiy Storchaka]
> I like the idea about adding a family of distribution generators. 
> They should check input parameters and make a precomputation and then > generate infinite sequence of specially distributed random numbers.

Would these distribution generators be implemented internally (see attached patch) or publicly exposed?
History
Date User Action Args
2013-09-01 14:37:04madison.maysetrecipients: + madison.may, tim.peters, rhettinger, mark.dickinson, pitrou, aisaac, westley.martinez, serhiy.storchaka
2013-09-01 14:37:04madison.maysetmessageid: <1378046224.47.0.370545684575.issue18844@psf.upfronthosting.co.za>
2013-09-01 14:37:04madison.maylinkissue18844 messages
2013-09-01 14:37:04madison.maycreate