Obtain the raw line of text read by CSVDictReader when reporting errors?

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Fri Sep 23 19:58:57 EDT 2016


On Friday, September 23, 2016 at 3:38:21 AM UTC+12, Chris Angelico wrote:
> This is why, despite the confusion it sometimes causes, we all prefer
> duck typing to static typing. The csv.DictReader wants a "file-like
> object", not necessarily a file - and in this case, all it asks is an
> iterable of lines, so a simple generator will work. This is true of
> MANY, if not all, places that a file is used.

Duck type is great for sticking pieces of Python code together.

And anybody who doesn’t like it can go Java themselves...



More information about the Python-list mailing list