Cython API: Added an __iter__ method to the class Column_line (iterating
on the elements names) (previously an iteration would work but with unexpected results)
This commit is contained in:
@ -297,7 +297,7 @@ cdef class Column_multi_elts(Column) :
|
||||
cpdef set_line(self, index_t line_nb, object values):
|
||||
for element_name in values :
|
||||
self.set_item(line_nb, element_name, values[element_name])
|
||||
|
||||
|
||||
|
||||
######################################################################################################
|
||||
|
||||
@ -324,7 +324,15 @@ cdef class Column_line :
|
||||
def __repr__(self) :
|
||||
return str(self._column.get_line(self._index))
|
||||
|
||||
|
||||
|
||||
def __iter__(self) :
|
||||
cdef list elements_names
|
||||
cdef bytes element_name
|
||||
elements_names = self._column.elements_names
|
||||
for element_name in elements_names :
|
||||
yield element_name
|
||||
|
||||
|
||||
cpdef update(self, data): # TODO ?????
|
||||
if isinstance(data, dict):
|
||||
data=data.items()
|
||||
|
Reference in New Issue
Block a user