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 <>
Python-bugs-list mailing list

Reply via email to