[Python-Dev] Guarantee ordered dict literals in v3.7?

Steve Dower steve.dower at python.org
Tue Dec 19 02:38:18 EST 2017


On 18Dec2017 2309, Steven D'Aprano wrote:
> [A LOT OF THINGS I AGREE WITH]
I agree completely with Steven's reasoning here, and it bothers me that
what is an irrelevant change to many users (dict becoming ordered) seems
to imply that all users of dict have to be updated.

I have never needed OrderedDict before, and dict now also being ordered
doesn't mean that when I reach for it I'm doing it because I need an
ordered dict - I probably just need a regular dict. *Nothing* about dict
should change for me between versions.

Adding an option to pprint to explicitly control sorting without
changing the default is fine. Please stop assuming that everyone wants
an OrderedDict when they say dict. It's an invalid assumption.

Cheers,
Steve


More information about the Python-Dev mailing list