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 "<stdin>", line 1, in <module>
TypeError: slice indices must be integers or None or have an __index__ method
[66105 refs]

----------
assignee: mark.dickinson
messages: 174782
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: range slicing swallows exceptions from __index__ methods.

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

Reply via email to