Issue 6329: Fix iteration for memoryviews.

This commit is contained in:
Raymond Hettinger 2009-06-23 20:38:54 +00:00
parent b7706b58fa
commit 159eac92c5
3 changed files with 60 additions and 32 deletions

View file

@ -48,6 +48,12 @@ class AbstractMemoryTests:
for tp in self._types:
self.check_getitem_with_type(tp)
def test_iter(self):
for tp in self._types:
b = tp(self._source)
m = self._view(b)
self.assertEqual(list(m), [m[i] for i in range(len(m))])
def test_setitem_readonly(self):
if not self.ro_type:
return