Issue 6329: Fix iteration for memoryviews.

This commit is contained in:
Raymond Hettinger 2009-06-23 20:59:43 +00:00
parent ef087da9e7
commit 62641e9534
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