[issue18844] allow weights in random.choice

Serhiy Storchaka report at bugs.python.org
Sun Aug 10 12:32:42 CEST 2014


Serhiy Storchaka added the comment:

Other languages have no such handly feature as generators. NumPy provides the size parameter to all functions and generates a bunch of random numbers at time. This doesn't look pythonic (Python stdlib prefers iterators).

I believe a generator is most Pythonic and most handly solution of this issue on Python. And it is efficient enough.

----------

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


More information about the Python-bugs-list mailing list