Mark Dickinson added the comment:

I should note that this patch fixes/changes one other aspect of slice.indices:  
namely that it used to accept a negative length, and return essentially 
meaningless results in that case:

    >>> slice(0, 10, 1).indices(-3)
    (-3, -3, 1)

With the patch, it now raises ValueError if given a negative length:

    >>> slice(0, 10, 1).indices(-3)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: length should not be negative

----------

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

Reply via email to