MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / InstanceCSVParser

Class InstanceCSVParser

Solutions/5_2/reader.py:36–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 return { name: func(val) for name, func, val in zip(headers, self.types, row) }
35
36class InstanceCSVParser(CSVParser):
37 def __init__(self, cls):
38 self.cls = cls
39
40 def make_record(self, headers, row):
41 return self.cls.from_row(row)
42
43def read_csv_as_dicts(filename, types):
44 parser = DictCSVParser(types)

Callers 1

read_csv_as_instancesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected