New submission from Roy Smith <r...@panix.com>:

The docs don't say what happens if you call random.sample() with a population 
smaller than k.  Experimentally, it raises ValueError, but this should be 
documented.

I would have guessed it would return IndexError, by analogy to random.choice().

----------
assignee: docs@python
components: Documentation
messages: 164742
nosy: docs@python, roysmith
priority: normal
severity: normal
status: open
title: random.sample() docs unclear on k < len(population)
type: enhancement

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

Reply via email to