We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6433f71 commit c2ec2adCopy full SHA for c2ec2ad
1 file changed
tests/basics/getitem.py
@@ -21,6 +21,12 @@ def __getitem__(self, index):
21
except StopIteration:
22
pass
23
24
+# this class raises an IndexError to stop the iteration
25
+class A:
26
+ def __getitem__(self, i):
27
+ raise IndexError
28
+print(list(A()))
29
+
30
# this class raises a non-StopIteration exception on iteration
31
class A:
32
def __getitem__(self, i):
0 commit comments