Was dict subclass discrepancy "fixed" (issue 708)?

Hello, I am writing a book about Python 3 [0] and while researching the caveats of subclassing built-in types I discovered the page "Differences between PyPy and CPython" [1] and issue #708 "Discrepancy in dict subclass __getitem__ calls between CPython 2.7 and PyPy 1.5" [2]. [0] http://shop.oreilly.com/product/0636920032519.do [1] http://pypy.readthedocs.org/en/latest/cpython_differences.html#subclasses-of... [2] https://bitbucket.org/pypy/pypy/issue/708/discrepancy-in-dict-subclass-__get... However, when testing with pypy3-2.4.0 and pypy-2.4.0 my results were the same as with CPython, and not as documented in [1]. So was issue 708 "fixed" and now PyPy misbehaves in the same way as CPython? Thanks! Best, Luciano -- Luciano Ramalho Twitter: @ramalhoorg Professor em: http://python.pro.br Twitter: @pythonprobr

On Nov 19, 2014, at 12:06 PM, Luciano Ramalho <luciano@ramalho.org> wrote:
I'm still getting the expected discrepancy between the two: Exception raised on both pypy and pypy3, whereas __getitem__ isn’t called on CPython 2.7.5. You might want to double check your python binaries? -- Philip Jenvey

Hi, On 19 November 2014 23:52, Philip Jenvey <pjenvey@underboss.org> wrote:
I'm still getting the expected discrepancy between the two: Exception raised on both pypy and pypy3, whereas __getitem__ isn’t called on CPython 2.7.5. You might want to double check your python binaries?
Indeed, issue 708 isn't "fixed". However, our documentation is out-of-date: the (different) example given at http://pypy.readthedocs.org/en/latest/cpython_differences.html#subclasses-of... now works the same was as CPython. For reference, this example is: class D(dict): def __getitem__(self, key): return 42 d1 = {} d2 = D(a='foo') d1.update(d2) print d1['a'] I'm going to find another simple example to update the docs with... A bientôt, Armin.

Thanks Armin and Philip for responding and thanks Arming fixing the example in the docs. Best, Luciano On Thu, Nov 20, 2014 at 7:54 AM, Armin Rigo <arigo@tunes.org> wrote:
-- Luciano Ramalho Twitter: @ramalhoorg Professor em: http://python.pro.br Twitter: @pythonprobr

On Nov 19, 2014, at 12:06 PM, Luciano Ramalho <luciano@ramalho.org> wrote:
I'm still getting the expected discrepancy between the two: Exception raised on both pypy and pypy3, whereas __getitem__ isn’t called on CPython 2.7.5. You might want to double check your python binaries? -- Philip Jenvey

Hi, On 19 November 2014 23:52, Philip Jenvey <pjenvey@underboss.org> wrote:
I'm still getting the expected discrepancy between the two: Exception raised on both pypy and pypy3, whereas __getitem__ isn’t called on CPython 2.7.5. You might want to double check your python binaries?
Indeed, issue 708 isn't "fixed". However, our documentation is out-of-date: the (different) example given at http://pypy.readthedocs.org/en/latest/cpython_differences.html#subclasses-of... now works the same was as CPython. For reference, this example is: class D(dict): def __getitem__(self, key): return 42 d1 = {} d2 = D(a='foo') d1.update(d2) print d1['a'] I'm going to find another simple example to update the docs with... A bientôt, Armin.

Thanks Armin and Philip for responding and thanks Arming fixing the example in the docs. Best, Luciano On Thu, Nov 20, 2014 at 7:54 AM, Armin Rigo <arigo@tunes.org> wrote:
-- Luciano Ramalho Twitter: @ramalhoorg Professor em: http://python.pro.br Twitter: @pythonprobr
participants (3)
-
Armin Rigo
-
Luciano Ramalho
-
Philip Jenvey