On 24/10/2011 20:26, candide wrote:
Where is documented the behaviour of the standard function randrange in
the case of an empty list ? for instance randrange(42,33) ? May I rely
on an ValueError type error?
It's the same back to at least Python 2.5, so you can probably rely on
that behaviour.
Interestingly, the documentation says:
"""This is equivalent to choice(range(start, stop, step)), but doesn’t
actually build a range object."""
but for choice(seq) it says:
"""If seq is empty, raises IndexError."""
so it's not entirely equivalent.
--
http://mail.python.org/mailman/listinfo/python-list