[Python-Dev] How about updating OrderedDict in csv and configparser to regular dict?
steve at holdenweb.com
Thu Jan 31 06:04:17 EST 2019
I submitted the patch to make the csv module use an OrderedDict in
DictReader. It doesn't, AFAIR, use anything but the ordering property of
ordered dict, so the reversion to a simple dict should be perfectly OK as
long as no consumers have started to make use of specific OrderedDict
On Thu, Jan 31, 2019 at 7:55 AM INADA Naoki <songofacandy at gmail.com> wrote:
> csv.DictReader uses OrderedDict by default, from Python 3.6.
> But it doesn't make sense anymore, like namedtuple._asdict().
> How about changing default dict type back to regular dict.
> Python is widely used for handling learge data. So I think
> changing default dict type to OrderedDict was performance
> and memory usage regression in 3.6.
> Additionally, configparser uses OrderedDict by default from Python 3.6 too.
> I am not sure about `parser['section1'] == parser['section2']` is not used
> But we broke it once in 3.6 by changing dict to OrderedDict. Are there any
> issue report caused by this backward incompatibility?
> And I think performance and memory efficiency is not so important for
> configparser, unlike csv.
> * +1 about changing csv.DictReader's default dict type
> * +0.5 about changing configparser's default dict type.
> How do you think?
> INADA Naoki <songofacandy at gmail.com>
> Python-Dev mailing list
> Python-Dev at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev