[docs] [issue33114] random.sample() behavior is unexpected/unclear from docs
report at bugs.python.org
Sun Mar 25 02:05:09 EDT 2018
Tim Peters <tim at python.org> added the comment:
There's nothing in the docs I can see that implies `sample(x, n)` is a prefix of what `sample(x, n+1)` would have returned had the latter been called instead. If so, then - as always - it's "at your own risk" when you rely on behaviors that haven't been specified. Since the universe of _possible_ behaviors that haven't been specified is immense, I'd rather we didn't even start to list all of them ;-)
Seriously, when the docs don't promise something, it's usually a mistake to assume they just forgot to mention it. I'd leave the docs alone in this case.
Python tracker <report at bugs.python.org>
More information about the docs