[issue18844] allow weights in random.choice

Antoine Pitrou report at bugs.python.org
Thu Apr 7 03:47:20 EDT 2016


Antoine Pitrou added the comment:

> Suggestion: if you want to go that way, return a single number if `amount` is not provided (so make the default value for `amount` None rather than 1). If `amount=1` is explicitly given, a list containing one item should be returned.

+1

----------

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


More information about the Python-bugs-list mailing list