MCPcopy Index your code
hub / github.com/python/cpython / _dict_to_list

Method _dict_to_list

Lib/csv.py:214–220  ·  view source on GitHub ↗
(self, rowdict)

Source from the content-addressed store, hash-verified

212 return self.writerow(header)
213
214 def _dict_to_list(self, rowdict):
215 if self.extrasaction == "raise":
216 wrong_fields = rowdict.keys() - self.fieldnames
217 if wrong_fields:
218 raise ValueError("dict contains fields not in fieldnames: "
219 + ", ".join([repr(x) for x in wrong_fields]))
220 return (rowdict.get(key, self.restval) for key in self.fieldnames)
221
222 def writerow(self, rowdict):
223 return self.writer.writerow(self._dict_to_list(rowdict))

Callers 1

writerowMethod · 0.95

Calls 3

keysMethod · 0.45
joinMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected