[pypy-svn] pypy numpy-exp: update the demo

fijal commits-noreply at bitbucket.org
Fri Feb 11 09:34:50 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-exp
Changeset: r41811:6f8db8706654
Date: 2011-02-11 10:34 +0200
http://bitbucket.org/pypy/pypy/changeset/6f8db8706654/

Log:	update the demo

diff --git a/pypy/jit/tl/pypyjit_demo.py b/pypy/jit/tl/pypyjit_demo.py
--- a/pypy/jit/tl/pypyjit_demo.py
+++ b/pypy/jit/tl/pypyjit_demo.py
@@ -1,18 +1,9 @@
 
 try:
-    import pypyjit
-    pypyjit.set_param(threshold=3, inlining=True)
-
-    def sqrt(y, n=10000):
-        x = y / 2
-        while n > 0:
-            #assert y > 0 and x > 0
-            if y > 0 and x > 0: pass
-            n -= 1
-            x = (x + y/x) / 2
-        return x
-
-    print sqrt(1234, 4)
+    import numpy
+    a = numpy.array(range(10))
+    b = a + a + a
+    print b[3]
     
 except Exception, e:
     print "Exception: ", type(e)


More information about the Pypy-commit mailing list