On Sat, 2 Apr 2022 at 02:30, Christopher Barker <pythonchb@gmail.com> wrote:
On Fri, Apr 1, 2022 at 4:06 AM Steve Dower <steve.dower@python.org> wrote:
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.
I don't understand the issue here:
If we expose a "frozendict" as built in python object then only the API of that object needs to remain stable, not the implementation.
And it seems that's an API that is already clearly defined.
+ 1 from me -- just the other day I was wishing it was there.
There would presumably need to be be a C API as well, and that would probably expose more of the implementation unless handled carefully. Without seeing an actual implementation, it's hard to know for sure. Paul