summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/iter1.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/iter1.py')
-rw-r--r--tests/basics/iter1.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/iter1.py b/tests/basics/iter1.py
index c2ef86a635..5bd7f5090b 100644
--- a/tests/basics/iter1.py
+++ b/tests/basics/iter1.py
@@ -1,5 +1,14 @@
# test user defined iterators
+# this class is not iterable
+class NotIterable:
+ pass
+try:
+ for i in NotIterable():
+ pass
+except TypeError:
+ print('TypeError')
+
class MyStopIteration(StopIteration):
pass