New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyPy compatibility #327
Comments
Out of interest, is this using a released version of PyPy, or a development version? PyPy 1.4 says it supports Python 2.5, and I believe we're using some 2.6 features. Is PyPy 1.4 kind of 2.5+, or was this tested on the development version? Otherwise, this looks broadly sensible. Is that the best way to get the attribute? I would use |
Yes, pypy 1.4 implements python 2.5. Using object.getattribute does not work, because it has the very same behavior of using self._is_section_key directly. The "problem" is that in cpython, the builtin _getattribute does not respect the overridden methods of dict, and thus calls the original getitem, which works fine. However, pypy's getattribute does respect the overridden getitem, hence the problem. |
Looking at the module, I'm not actually sure that I see the problem: we're calling back into I look forward to giving PyPy 1.5 a spin! |
So, this is what happens when you do self._is_section_key inside the getitem:
I hope it's clearer now. |
Ah, that makes sense. I'd overlooked that we were replacing |
Yes, exactly. In both PyPy and CPython, class is implemented as a "GetSetProperty", See for PyPy: and for CPython: |
OK then, this looks sensible. |
I've turned your patch into a pull request, #331. Thanks again. |
The current version of IPython crashes on PyPy because of an infinite recursion inside Config.getitem. The different behavior of PyPy and CPython in these corner cases is documented here:
http://pypy.readthedocs.org/en/latest/cpython_differences.html#subclasses-of-built-in-types
The following patch fixes the bug and make IPython working on PyPy:
The text was updated successfully, but these errors were encountered: