[Python-Dev] Decision of having a deprecation period or not for changing csv.DictReader returning type.

Antoine Pitrou solipsis at pitrou.net
Sun Dec 17 13:57:39 EST 2017


On Mon, 18 Dec 2017 03:24:05 +0900
INADA Naoki <songofacandy at gmail.com> wrote:

> On Mon, Dec 18, 2017 at 12:46 AM, Guido van Rossum <guido at python.org> wrote:
> > My gut suggests me not to do this (neither here nor in other similar cases).
> > I doubt there's much of a performance benefit anyway.  
> 
> OrderedDict uses 2x memory than dict.
> So it affects memory usage of applications loading large CSV with DictReader.
> 
> While I think application should use tuple when memory consumption is
> matter, there is significant benefit.

Or they should use a dict-of-lists instead of a list-of-dicts.
Or they should simply switch to Pandas.

Simply put, I doubt using DictReader is a sensible decision if you're
writing performance-sensitive code.

Regards

Antoine.




More information about the Python-Dev mailing list