Re: randrange exceptional behavior

2011-10-24 Thread candide
Le 24/10/2011 22:09, MRAB a écrit : but for choice(seq) it says: Ah of course, I should have checked there """If seq is empty, raises IndexError.""" > Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: randrange exceptional behavior

2011-10-24 Thread MRAB
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.