Cython API: set_line of Column_multi_elts now accept as values argument

any class where values are referenced by keys with an iterator
This commit is contained in:
Celine Mercier
2017-07-05 17:32:32 +02:00
parent d10192ab0e
commit 5ee0b3989a
2 changed files with 9 additions and 7 deletions

View File

@ -31,7 +31,8 @@ cdef class Column(OBIWrapper) :
cdef class Column_multi_elts(Column) :
cpdef set_line(self, index_t line_nb, dict values)
# The type of [values] can be dict, Column_line, or any other class with values referenced by keys with an iterator [for key in values]
cpdef set_line(self, index_t line_nb, object values)
cdef class Column_line:

View File

@ -1,4 +1,5 @@
#cython: language_level=3
from obitools3.dms.column import typed_column
@ -293,7 +294,7 @@ cdef class Column_multi_elts(Column) :
def __getitem__(self, index_t line_nb):
return Column_line(self, line_nb)
cpdef set_line(self, index_t line_nb, dict values):
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])