Message174678
| Author |
mark.dickinson |
| Recipients |
Paul.Upchurch, eric.araujo, hynek, mark.dickinson, ned.deily, serhiy.storchaka |
| Date |
2012年11月03日.19:28:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1351970900.58.0.0409354765513.issue14794@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|