Author rhettinger
Recipients Christian.Kleineidam, aisaac, dkorchem, madison.may, mark.dickinson, neil.g, pitrou, rhettinger, serhiy.storchaka, tim.peters, westley.martinez, xksteven
Date 2016-08-15.17:29:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471282160.73.0.056697048077.issue18844@psf.upfronthosting.co.za>
In-reply-to
Content
FWIW, I have four full days set aside for the upcoming pre-feature release sprint which is dedicated to taking time to thoughtfully evaluate pending feature requests.  In the meantime, I'm contacting Alan Downey for a consultation for the best API for this.  As mentioned previously, the generator version isn't compatible with the design of the rest of the module that allows streams to have their state saved and restored at arbitrary points in the sequence.  One API would be to create a list all at once (like random.sample does).  Another would be to have two steps (like str.maketrans and str.translate).  Ideally, the API should integrate neatly with collections.Counter as a possible input for the weighting.  Hopefully, Alan can also comment on the relative frequency of small integer weightings versus the general case (the former benefits from a design using random.choice() applied to Counter.elements() and the latter benefits from a design with accumulate() and bisect()).  Note, this is a low priority feature (no real demonstrated need, there is already a recipe for it in the docs, and once the best API have been determined, the code is so simple that any of us could implement it in only a few minutes).
History
Date User Action Args
2016-08-15 17:29:20rhettingersetrecipients: + rhettinger, tim.peters, mark.dickinson, pitrou, aisaac, westley.martinez, serhiy.storchaka, neil.g, madison.may, dkorchem, Christian.Kleineidam, xksteven
2016-08-15 17:29:20rhettingersetmessageid: <1471282160.73.0.056697048077.issue18844@psf.upfronthosting.co.za>
2016-08-15 17:29:20rhettingerlinkissue18844 messages
2016-08-15 17:29:20rhettingercreate