On Nov 7, 2017, at 07:12, Antoine Pitrou <solip...@pitrou.net> wrote:

> The problem is this is taking things to a level of precision that makes
> the guarantee tedious to remember and reason about.
> 
> The only thing that's friendly to (non-expert) users is either "dicts
> are always ordered [by insertion order], point bar" or "dicts are not
> ordered, point bar".  Anything in-between, with reservations depending
> on which operations are invoked and when, is not really helpful to the
> average (non-expert) user.
> 
> Which is why I think the user-friendliness argument does not apply if
> order ceases to be guaranteed after __del__ is called.

That’s a very important point.  If it’s difficult to explain, teach, and retain 
the different ordering guarantees between built-in dict and OrderedDict, it 
might in fact be better to not guarantee any ordering for built-in dict *in the 
language specification*.  Otherwise we might need a section as big as chapter 5 
in the Python Language Reference just to dict ordering semantics. ;)

Cheers,
-Barry

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to