Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04e2428

Browse files
committed
whatsnew: slice.index no longer accepts negative values (or overflows).
1 parent 8dffa0e commit 04e2428

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Doc/whatsnew/3.4.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,11 @@ Changes in the Python API
17201720
informative :exc:`ValueError` rather than the previous more mysterious
17211721
:exc:`AttributeError` (:issue:`9177`).
17221722

1723+
* :meth:`slice.indices` no longer produces an :exc:`OverflowError` for huge
1724+
values. As a consequence of this fix, :meth:`slice.indices` now raises a
1725+
:exc:`ValueError` if given a negative length; previously it returned nonsense
1726+
values (:issue:`14794`).
1727+
17231728

17241729
Changes in the C API
17251730
--------------------

0 commit comments

Comments
 (0)