[Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

David Mertz mertz at gnosis.cx
Fri Sep 9 15:01:08 EDT 2016


It seems unlikely, but not inconceivable, that someday in the future
someone will implement a dictionary that is faster than current versions
but at the cost of losing inherent ordering.

It feels best to me only to promise order in specific cases like kwargs,
but say nothing (even in 3.6 or 3.7) about the requirement for how dict
itself is implemented.

On Sep 9, 2016 11:39 AM, "Barry Warsaw" <barry at python.org> wrote:

> On Sep 09, 2016, at 01:08 PM, Elvis Pranskevichus wrote:
>
> >Are there any downsides to explicitly specifying that all dicts are
> ordered?
> >People will inevitably start relying on this behaviour, and this will
> >essentially become the *de-facto* spec, so alternative Python
> implementations
> >will have to follow suit anyway.
>
> It *might* make sense to revisit this once 3.5 is no longer maintained at
> all,
> but I think Guido's exactly right in his analysis.  If people start
> relying on
> all dicts being ordered now, their code won't be compatible with both 3.5
> and
> 3.6, and I think it's important to emphasize this to developers.
>
> Cheers,
> -Barry
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
> mertz%40gnosis.cx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160909/2278ae7c/attachment.html>


More information about the Python-Dev mailing list