Re: [Python-Dev] The current dict is not an "OrderedDict"

2017年11月07日 07:18:58 -0800

On Wed, 8 Nov 2017 01:56:42 +1100
Steven D'Aprano <[email protected]> wrote:
> 
> I think that Nick's intent was not to say that after a single deletion, 
> the ordering guarantee goes away "forever", but that a deletion may be 
> permitted to reorder the keys, after which further additions will honour 
> insertion order. At least, that's how I interpret him.
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.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
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