On 4/1/2022 11:48 AM, zhang kai wrote:
Thanks Victor and Pablo. I will check the discussion of PEP 603. It's a little weird to use the immutables library when it's code in already in CPython but I'm glad it's anĀ option.
The main difference is that 'immutables' offers you a stable/versioned interface to use it, while the one that's in CPython is an internal implementation detail. If one day we find a better design, we can just switch to it, while 'immutables' probably can't. If we've exposed as a public interface in the core runtime, it's much more complicated.
(For what it's worth, the major thing that held up contextvars in the first place was justifying why it needed a new data structure that wasn't already in the core runtime. So we didn't adopt it lightly, and making sure we kept the freedom to change it was an important compromise.)
There are plenty of other things in this same category, and because we want to keep things as stable as possible while also improving performance and reliability, we have to keep pretty tight limits on what we promise will remain stable. Most of our discussions are about finding this balance ;)
Cheers, Steve _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/KDJLDBZ5FIMUCVBKGEWCA2T4NGTZB4CW/ Code of Conduct: http://python.org/psf/codeofconduct/