diff Lib/test/test_array.py @ 27128:047b6e16ab2e legacy-trunk

SF patch #662433: Fill arraymodule's tp_iter and sq_contains slots
author Raymond Hettinger <python@rcn.com>
date Tue, 07 Jan 2003 01:58:52 +0000
parents f4cd78b3b774
children 7f0074ee8ab9
line wrap: on
line diff
--- a/Lib/test/test_array.py	Tue Jan 07 00:29:07 2003 +0000
+++ b/Lib/test/test_array.py	Tue Jan 07 01:58:52 2003 +0000
@@ -356,6 +356,12 @@
         a[2:3] = ins
         b[slice(2,3)] = ins
         c[2:3:] = ins
+        # iteration and contains
+        a = array.array(type, range(10))
+        vereq(list(a), range(10))
+        b = array.array(type, [20])
+        vereq(a[-1] in a, True)
+        vereq(b[0] not in a, True)
 
     # test that overflow exceptions are raised as expected for assignment
     # to array of specific integral types