On Nov 6, 2017, at 11:23, Paul G <p...@ganssle.io> wrote:
> 
> Is there a major objection to just adding in explicit syntax for 
> order-preserving dictionaries?

I don’t think new syntax is necessary.  We already have OrderedDict, which to 
me is a perfectly sensible way to spell “I need a mapping that preserves 
insertion order”, and the extra import doesn’t bother me.

I’m not saying whether or not to make the language guarantee that built-in dict 
preserves order.  I’m just saying that if we don’t make that language change, 
we already have everything we need to support both use cases.

If we did make the change, it’s possible we would need a way to explicit say 
that order is not preserved.  That seems a little weird to me, but I suppose it 
could be useful.  I like the idea previously brought up that iteration order be 
deliberately randomized in that case, but we’d still need a good way to spell 
that.

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