Raymond Hettinger added the comment:

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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18844>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to