There must be a better way (correction)

Tim Chase python.list at tim.thechases.com
Tue Apr 23 11:02:55 EDT 2013


On 2013-04-23 09:30, Tim Chase wrote:
> > But a csv.DictReader might still be more efficient. I never
> > tested. This is the only place I've used this "optimization".
> > It's fast enough. ;)
> 
> I believe the csv module does all the work at c-level, rather than
> as  pure Python, so it should be notably faster.

A little digging shows that csv.DictReader is pure Python, using the
underlying _csv.reader which is written in C for speed.

-tkc






More information about the Python-list mailing list