[Python-ideas] Dict literal use for custom dict classes

Eric Snow ericsnowcurrently at gmail.com
Thu Dec 17 13:46:26 EST 2015


On Wed, Dec 16, 2015 at 3:17 PM, Nathaniel Smith <njs at pobox.com> wrote:
> That's not so clear, actually! It turns out that PyPy was able to make
> their regular 'dict' implementation ordered, while at the same time
> making it faster and more memory-efficient compared to their previous
> (CPython-like) implementation:
>
>   http://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html
>
> So in PyPy all these issues are automatically solved for free. The
> $1e6-question these other proposals have to answer is, why not do what
> PyPy did? Maybe there is a good reason not to, but it seems like it'll
> be difficult to get consensus on moving forward on any of these other
> more complicated proposals until someone has first made a serious
> attempt at porting PyPy's dict to CPython and is able to clearly
> describe why it didn't work.

If I recall correctly, the PyPy implementation is either based on a
proposal by Raymond Hettinger [1] or on the same concept.  Note that I
mention the approach as an alternative in PEP 468.

-eric

[1] original: https://mail.python.org/pipermail/python-dev/2012-December/123028.html
     revisited:
https://mail.python.org/pipermail/python-dev/2013-May/126327.html


More information about the Python-ideas mailing list