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

Barry Warsaw barry at python.org
Sun Nov 5 12:37:33 EST 2017

On Nov 4, 2017, at 11:35, Guido van Rossum <guido at python.org> wrote:
> This sounds reasonable -- I think when we introduced this in 3.6 we were worried that other implementations (e.g. Jython) would have a problem with this, but AFAIK they've reported back that they can do this just fine. So let's just document this as a language guarantee.

The other concern was backward compatibility issues.  For example, if 3.7 makes this guarantee official, and folks write code with this assumption that has to work with older versions of Python, then that code could be buggy in previous versions and work in 3.7.  This will probably be most evident in test suites, and such failures are often mysterious to debug (as we’ve seen in the past).

That doesn’t mean we shouldn’t do it, but it does mean we have to be careful and explicit to educate users about how to write safe multi-Python-version code.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171105/0eb8f4fc/attachment.sig>

More information about the Python-Dev mailing list