diff options
Diffstat (limited to 'python/src/sa/int_list.pxi')
-rw-r--r-- | python/src/sa/int_list.pxi | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/python/src/sa/int_list.pxi b/python/src/sa/int_list.pxi index ad14bc9c..63c0fe67 100644 --- a/python/src/sa/int_list.pxi +++ b/python/src/sa/int_list.pxi @@ -7,10 +7,6 @@ from libc.stdlib cimport malloc, realloc, free from libc.string cimport memset, memcpy cdef class IntList: - cdef int size - cdef int increment - cdef int len - cdef int* arr def __cinit__(self, int size=0, int increment=1, int initial_len=0): if initial_len > size: @@ -82,6 +78,11 @@ cdef class IntList: def __dealloc__(self): free(self.arr) + def __iter__(self): + cdef int i + for i in range(self.len): + yield self.arr[i] + def __getitem__(self, index): cdef int i, j, k if isinstance(index, int): |