Mark Dickinson added the comment:

> One to make it return a single number if amount == 1 and the other to check 
> that the amount > 1.

I think that's a dangerous API. Any code making a call to "weighted_choice(..., 
amount=n)" for variable n now has to be prepared to deal with two possible 
result types. It would be easy to introduce buggy code that fails in the corner 
case n = 1.

----------

_______________________________________
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