[issue18844] allow weights in random.choice

Raymond Hettinger report at bugs.python.org
Sun Aug 10 11:45:12 CEST 2014


Raymond Hettinger added the comment:

I'm adverse to adding the generator magic and the level of complexity in this patch.  Please aim for the approach I outlined above (one function to build cumulative weights and another function to choose the value).

Since this isn't a new problem, please take a look at how other languages and packages have solved the problem.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18844>
_______________________________________


More information about the Python-bugs-list mailing list