[Python-Dev] Guarantee ordered dict literals in v3.7?
Guido van Rossum
guido at python.org
Sun Nov 5 12:50:41 EST 2017
Yup. At least such code will not break in 3.5.
In general if you write code using a newer version you should expect
arbitrary breakage when trying to run it under older versions. There is no
compatibility guarantee in that direction for anything anyways.
I don't see this as a reason to not put this into the language spec at 3.7.
On Sun, Nov 5, 2017 at 9:37 AM, Barry Warsaw <barry at python.org> wrote:
> 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.
> Python-Dev mailing list
> Python-Dev at python.org
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev