@@ -85,7 +85,7 @@ def fill_properties(self):
8585 def get_value (self , object , prop : Property ):
8686 # in case value is not overwritten on the object, it's the Property object itself (= as defined in the Class)
8787 val = getattr (object , prop ._name )
88- if prop ._py_type == list [ int ] or prop . _py_type == list [ float ] :
88+ if prop ._py_type == list :
8989 if (val == np .array (prop )).all ():
9090 return prop ._py_type ()
9191 elif prop ._py_type == np .ndarray :
@@ -161,28 +161,20 @@ def unmarshal(self, data: bytes):
161161 # access the FB byte vector information
162162 start = table .Vector (o )
163163 size = table .VectorLen (o )
164-
165164 # slice the vector as a requested type
166165 val = prop ._py_type (table .Bytes [start :start + size ])
167166 elif prop ._ob_type == OBXPropertyType_IntVector :
168167 val = table .GetVectorAsNumpy (flatbuffers .number_types .Int32Flags , o )
169- if prop ._py_type == list [int ]:
170- val = val .tolist ()
171168 elif prop ._ob_type == OBXPropertyType_LongVector :
172169 val = table .GetVectorAsNumpy (flatbuffers .number_types .Int64Flags , o )
173- if prop ._py_type == list [int ]:
174- val = val .tolist ()
175170 elif prop ._ob_type == OBXPropertyType_FloatVector :
176171 val = table .GetVectorAsNumpy (flatbuffers .number_types .Float32Flags , o )
177- if prop ._py_type == list [float ]:
178- val = val .tolist ()
179172 elif prop ._ob_type == OBXPropertyType_DoubleVector :
180173 val = table .GetVectorAsNumpy (flatbuffers .number_types .Float64Flags , o )
181- if prop ._py_type == list [float ]:
182- val = val .tolist ()
183174 else :
184175 val = table .Get (prop ._fb_type , o + table .Pos )
185-
176+ if prop ._py_type == list :
177+ val = val .tolist ()
186178 setattr (obj , prop ._name , val )
187179 return obj
188180
0 commit comments