2011/2/3 Fredrik Johansson <fredrik.johans...@gmail.com>: > Indeed (that user was me, and it was nice to see the problem fixed so > quickly!). There is one incompatibility left between CPython and PyPy > that breaks some functions in mpmath. In CPython, round() and > functions in the math module accept (and convert) inputs of any custom > type with a __float__ method, whereas they trigger a TypeError in PyPy > (1.4).
It seems corrected today; the script below indeed fails with pypy-1.4. >>>> class C: .... def __float__(self): return 42.0 .... >>>> x = C() >>>> import math >>>> math.sqrt(x) 6.48074069840786 >> I don't remember how fast is was, though. > > On win32, PyPy 1.4 is about 40% slower than CPython 2.6 for running > the entire set of tests. This is probably mostly due to the slowness > of longs in PyPy. However, much of the regular floating point code > seems to be slower in PyPy as well. The standard operations, or the math module? It seems that every function in the math module releases the GIL. This may explain some slowness. -- Amaury Forgeot d'Arc _______________________________________________ pypy-dev@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev