Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

If all you want is a sample where k==1, then use choice().  That is clearer and 
more efficient.  

The sample() function is for sampling without replacement which only makes 
sense when k > 1; otherwise, choice() or choices() is usually what you want.

----------
assignee:  -> rhettinger

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

Reply via email to