[PyPy-issue] [issue708] Discrepancy in dict subclass __getitem__ calls between CPython 2.7 and PyPy 1.5

Ryan McGuire pypy-dev-issue at codespeak.net
Sun May 1 20:19:08 CEST 2011


New submission from Ryan McGuire <codespeak.net at enigmacurry.com>:

A subclass of dict that sets it's __dict__ object to itself exhibits strange behavior in PyPy when compared to how 
it runs in CPython 2.7.1

When attribute access is done on such an object, PyPy calls the __getitem__ method whereas CPython does not.

Attached is an example of what I'm trying. I've also pasted it here: https://gist.github.com/950696

This is a greatly abbreviated example, to show the root problem. For reference, the real world code is part of 
Blogofile here: https://github.com/EnigmaCurry/blogofile/blob/plugins/blogofile/cache.py

I'm using the binary release version of PyPy 1.5 x64 on Ubuntu Linux 10.04

Thanks for PyPy!

----------
effort: ???
files: test.py
messages: 2470
nosy: EnigmaCurry, pypy-issue
priority: bug
release: ???
status: unread
title: Discrepancy in dict subclass __getitem__ calls between CPython 2.7 and PyPy 1.5

_______________________________________________________
PyPy development tracker <pypy-dev-issue at codespeak.net>
<https://codespeak.net/issue/pypy-dev/issue708>
_______________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 930 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-issue/attachments/20110501/e3460187/attachment.py>


More information about the Pypy-issue mailing list