Tim Peters added the comment:

I have a question about this new snippet in choice():

+        if i == n and n > 0:
+            i = n - 1

What's the purpose of the "and n > 0" clause?  Without it, if i == n == 0 then 
i will be set to -1, which is just as good as 0 for the purpose of raising 
IndexError (seq[any_int] raises IndexError when seq is empty).

----------

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

Reply via email to