[issue16402] range slicing swallows exceptions from __index__ methods.

2012-11-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue16402] range slicing swallows exceptions from __index__ methods.

2012-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 94d15358ad6e by Mark Dickinson in branch '3.2': Issue #16402: In range slicing, fix shadowing of exceptions from __index__ method. http://hg.python.org/cpython/rev/94d15358ad6e New changeset 2b656a2cf7ef by Mark Dickinson in branch '3.3': Issue #16

[issue16402] range slicing swallows exceptions from __index__ methods.

2012-11-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue16402] range slicing swallows exceptions from __index__ methods.

2012-11-04 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch. -- keywords: +patch stage: -> patch review type: -> behavior versions: +Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file27879/issue16402.patch ___ Python tracker

[issue16402] range slicing swallows exceptions from __index__ methods.

2012-11-04 Thread Mark Dickinson
New submission from Mark Dickinson: >>> class A(object): ... def __index__(self): raise ZeroDivisionError ... [66062 refs] >>> a = A() [66065 refs] >>> range(10)[0:a] Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __inde