[pypy-dev] works in python2.4, fails in pypy

Ondrej Certik ondrej at certik.cz
Mon Aug 25 16:20:40 CEST 2008

On Mon, Aug 25, 2008 at 4:04 PM, Armin Rigo <arigo at tunes.org> wrote:
> Hi Ondrej,
> On Sun, Aug 24, 2008 at 04:08:29PM +0200, Ondrej Certik wrote:
>> TypeError: instance layout conflicts in multiple inheritance
> Not completely surprizingly, our multiple inheritance "instance layout
> conflict" condition is not 100% the same as CPython's (as the latter is
> really obscure and based on conditions like the size of C-level
> structures).  Still, I think that this case should work, so it looks
> like a bug in PyPy.
> Filed issue #390: https://codespeak.net/issue/pypy-dev/issue390

Thanks Armin for looking into this. Btw, if it helps, ironpython also
fails on conflict1.py from #390:

$ ipy conflict1.py
Traceback (most recent call last):
  File conflict1, line unknown, in Initialize
  File mscorlib, line unknown, in get_Item
KeyError: The given key was not present in the dictionary.

Also I don't like mutliple inheritance, so we should just fix sympy
and be done with it.

Unfortunately IronPython fails later too and Jython as well:

$ /home/ondra/ext/jython/jython
Jython 2.5a1+ (asm:4943:4945, Jul 15 2008, 15:30:04)
[Java HotSpot(TM) Server VM (Sun Microsystems Inc.)] on java1.5.0_15
Type "help", "copyright", "credits" or "license" for more information.
>>> import sympy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sympy/__init__.py", line 16, in <module>
    from sympy.core import *
  File "sympy/core/__init__.py", line 4, in <module>
    from basic import Basic, S, C, sympify
  File "sympy/core/basic.py", line 236, in <module>
    class Basic(AssumeMeths):
TypeError: Error when calling the metaclass bases
    mro() returned base with unsuitable layout ('Basic')

So this suggests that sympy code is not standard.


More information about the Pypy-dev mailing list