[pypy-svn] r75352 - in pypy/release/1.3.x/pypy: doc doc/play1 interpreter/test jit/backend/llgraph jit/backend/x86/test jit/codewriter jit/codewriter/test jit/metainterp jit/metainterp/test lib/app_test lib/app_test/ctypes_tests module/__builtin__ module/__builtin__/test module/_codecs/test module/_file/test module/cpyext module/cpyext/test module/imp/test module/itertools/test rlib rlib/parsing/test rlib/test rpython rpython/lltypesystem rpython/lltypesystem/test rpython/memory/gc rpython/numpy/test rpython/ootypesystem rpython/ootypesystem/test rpython/test rpython/tool tool tool/release translator/c translator/c/src translator/c/test

fijal at codespeak.net fijal at codespeak.net
Sun Jun 13 00:12:36 CEST 2010


Author: fijal
Date: Sun Jun 13 00:12:31 2010
New Revision: 75352

Added:
   pypy/release/1.3.x/pypy/doc/release-1.3.0.txt
      - copied unchanged from r75351, pypy/trunk/pypy/doc/release-1.3.0.txt
   pypy/release/1.3.x/pypy/module/cpyext/cdatetime.py
      - copied unchanged from r75351, pypy/trunk/pypy/module/cpyext/cdatetime.py
   pypy/release/1.3.x/pypy/tool/release/
      - copied from r75351, pypy/trunk/pypy/tool/release/
Removed:
   pypy/release/1.3.x/pypy/doc/play1/
   pypy/release/1.3.x/pypy/module/cpyext/datetime.py
Modified:
   pypy/release/1.3.x/pypy/doc/how-to-release.txt
   pypy/release/1.3.x/pypy/interpreter/test/test_function.py
   pypy/release/1.3.x/pypy/jit/backend/llgraph/llimpl.py
   pypy/release/1.3.x/pypy/jit/backend/x86/test/test_gc_integration.py
   pypy/release/1.3.x/pypy/jit/backend/x86/test/test_regalloc.py
   pypy/release/1.3.x/pypy/jit/codewriter/support.py
   pypy/release/1.3.x/pypy/jit/codewriter/test/test_flatten.py
   pypy/release/1.3.x/pypy/jit/metainterp/blackhole.py
   pypy/release/1.3.x/pypy/jit/metainterp/pyjitpl.py
   pypy/release/1.3.x/pypy/jit/metainterp/test/test_basic.py
   pypy/release/1.3.x/pypy/jit/metainterp/test/test_loop.py
   pypy/release/1.3.x/pypy/jit/metainterp/test/test_recursive.py
   pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_functions.py
   pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_unicode.py
   pypy/release/1.3.x/pypy/lib/app_test/test_functools.py
   pypy/release/1.3.x/pypy/module/__builtin__/functional.py
   pypy/release/1.3.x/pypy/module/__builtin__/test/test_classobj.py
   pypy/release/1.3.x/pypy/module/__builtin__/test/test_functional.py
   pypy/release/1.3.x/pypy/module/_codecs/test/test_codecs.py
   pypy/release/1.3.x/pypy/module/_file/test/test_file_extra.py
   pypy/release/1.3.x/pypy/module/cpyext/__init__.py
   pypy/release/1.3.x/pypy/module/cpyext/api.py
   pypy/release/1.3.x/pypy/module/cpyext/test/test_cpyext.py
   pypy/release/1.3.x/pypy/module/imp/test/test_app.py
   pypy/release/1.3.x/pypy/module/itertools/test/test_itertools.py
   pypy/release/1.3.x/pypy/rlib/parsing/test/test_regexparse.py
   pypy/release/1.3.x/pypy/rlib/rgc.py
   pypy/release/1.3.x/pypy/rlib/test/test_rbigint.py
   pypy/release/1.3.x/pypy/rlib/test/test_rmmap.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/llarena.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/lloperation.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/lltype.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/opimpl.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/rclass.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/rffi.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_ll2ctypes.py
   pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_lltype.py
   pypy/release/1.3.x/pypy/rpython/memory/gc/generation.py
   pypy/release/1.3.x/pypy/rpython/memory/gc/marksweep.py
   pypy/release/1.3.x/pypy/rpython/normalizecalls.py
   pypy/release/1.3.x/pypy/rpython/numpy/test/test_array.py
   pypy/release/1.3.x/pypy/rpython/ootypesystem/ootype.py
   pypy/release/1.3.x/pypy/rpython/ootypesystem/rootype.py
   pypy/release/1.3.x/pypy/rpython/ootypesystem/test/test_oolist.py
   pypy/release/1.3.x/pypy/rpython/rbuiltin.py
   pypy/release/1.3.x/pypy/rpython/test/test_llinterp.py
   pypy/release/1.3.x/pypy/rpython/test/test_rfloat.py
   pypy/release/1.3.x/pypy/rpython/test/test_rint.py
   pypy/release/1.3.x/pypy/rpython/test/test_rlist.py
   pypy/release/1.3.x/pypy/rpython/test/test_rvirtualizable2.py
   pypy/release/1.3.x/pypy/rpython/tool/rffi_platform.py
   pypy/release/1.3.x/pypy/tool/sourcetools.py
   pypy/release/1.3.x/pypy/translator/c/funcgen.py
   pypy/release/1.3.x/pypy/translator/c/src/int.h
   pypy/release/1.3.x/pypy/translator/c/test/test_extfunc.py
   pypy/release/1.3.x/pypy/translator/c/test/test_typed.py
Log:
Merge from trunk until HEAD


Modified: pypy/release/1.3.x/pypy/doc/how-to-release.txt
==============================================================================
--- pypy/release/1.3.x/pypy/doc/how-to-release.txt	(original)
+++ pypy/release/1.3.x/pypy/doc/how-to-release.txt	Sun Jun 13 00:12:31 2010
@@ -4,12 +4,13 @@
 Overview
 ---------
 
-As a meta rule setting up issues in the tracker for items here may help not forgetting things.
-A set of todo files may also work.
+As a meta rule setting up issues in the tracker for items here may help not
+forgetting things. A set of todo files may also work.
 
 Check and prioritize all issues for the release, postpone some if necessary,
-create new  issues also as necessary. A meeting (or meetings) should be organized
-to decide what things are priorities, should go in and work for the release. 
+create new  issues also as necessary. A meeting (or meetings) should be
+organized to decide what things are priorities, should go in and work for
+the release. 
 
 An important thing is to get the documentation into an up-to-date state!
 
@@ -25,34 +26,21 @@
   necessary
 * update pypy/doc/contributor.txt (and possibly LICENSE)
 * update README
-* update pypy.org (under extradoc/pypy.org), rebuild and commit
-* build following binaries (supported versions for now):
-  JIT: windows, linux, os/x
-  no JIT: windows, linux, os/x
-  sandbox: linux, os/x
-  stackless: windows, linux, os/x
+* go to pypy/tool/release and run:
+  force-builds.py /release/<release branch>
+* wait for builds to complete, make sure there are no failures
+* run pypy/tool/release/make_release.py, this will build necessary binaries
+  and upload them to pypy.org
+
+  Following binaries should be built, however, we need more buildbots:
+    JIT: windows, linux, os/x
+    no JIT: windows, linux, os/x
+    sandbox: linux, os/x
+    stackless: windows, linux, os/x
 
-XXX stuff below is out-of-date or at least needs some review
 * write release announcement pypy/doc/release-x.y(.z).txt
   the release announcement should contain a direct link to the download page
-* update pypy/doc/getting-started.txt links at the top
-  and release number references, make sure it is generally up-to-date
-* use, after the necessary updates, pypy/tool/makerelease.py to
-  make the tarballs on codespeak; this generates html doc for the
-  tarballs too.  Use::
-     
-     makerelease -tag .z pypy-x.y.z
-
-  to tag and produce final tarballs. Without the '-tag' this can
-  be used to make pre-release testing tarballs.
-* nowadays we have an extensive set of nightly builds and test
-  runs. Is probably good to do some minimal testing of the tarballs,
-  especially to check that things work even outside a working copy or
-  if some stuff is missing. We have some support for running part of
-  our nightly tests on tarballs (see
-  http://codespeak.net/svn/user/pedronis/tarball-testing).
-* write a news item for the release in pypy/doc/news.txt
-* update http://codespeak.net/svn/pypy/dist and codespeak's
-  precomputed html files
-* send announcements to pypy-dev, pypy-funding, python-list,
+* update pypy.org (under extradoc/pypy.org), rebuild and commit
+* post announcement on morepypy.blogspot.com
+* send announcements to pypy-dev, python-list,
   python-announce, python-dev ...

Modified: pypy/release/1.3.x/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/release/1.3.x/pypy/interpreter/test/test_function.py	(original)
+++ pypy/release/1.3.x/pypy/interpreter/test/test_function.py	Sun Jun 13 00:12:31 2010
@@ -158,13 +158,6 @@
         assert res[0] == 42
         assert res[1] == {'something': 23}
 
-    def test_kwargs_sets_positional_mixed(self):
-        def func(arg1, **kw):
-            return arg1, kw
-        res = func(arg1=42, something=23)
-        assert res[0] == 42
-        assert res[1] == {'something': 23}
-
     def test_kwargs_sets_positional_twice(self):
         def func(arg1, **kw):
             return arg1, kw

Modified: pypy/release/1.3.x/pypy/jit/backend/llgraph/llimpl.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/backend/llgraph/llimpl.py	(original)
+++ pypy/release/1.3.x/pypy/jit/backend/llgraph/llimpl.py	Sun Jun 13 00:12:31 2010
@@ -4,7 +4,6 @@
 when executing on top of the llinterpreter.
 """
 
-import sys
 from pypy.objspace.flow.model import Variable, Constant
 from pypy.annotation import model as annmodel
 from pypy.jit.metainterp.history import (ConstInt, ConstPtr,

Modified: pypy/release/1.3.x/pypy/jit/backend/x86/test/test_gc_integration.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/backend/x86/test/test_gc_integration.py	(original)
+++ pypy/release/1.3.x/pypy/jit/backend/x86/test/test_gc_integration.py	Sun Jun 13 00:12:31 2010
@@ -3,7 +3,7 @@
 """
 
 import py
-from pypy.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\
+from pypy.jit.metainterp.history import BoxInt, ConstInt,\
      BoxPtr, ConstPtr, TreeLoop
 from pypy.jit.metainterp.resoperation import rop, ResOperation
 from pypy.jit.codewriter import heaptracker
@@ -22,7 +22,6 @@
 from pypy.jit.backend.x86.test.test_regalloc import BaseTestRegalloc
 from pypy.jit.backend.x86.regalloc import X86RegisterManager, X86FrameManager,\
      X86XMMRegisterManager
-from pypy.rpython.annlowlevel import llhelper
 
 class MockGcRootMap(object):
     def get_basic_shape(self):

Modified: pypy/release/1.3.x/pypy/jit/backend/x86/test/test_regalloc.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/backend/x86/test/test_regalloc.py	(original)
+++ pypy/release/1.3.x/pypy/jit/backend/x86/test/test_regalloc.py	Sun Jun 13 00:12:31 2010
@@ -3,7 +3,7 @@
 """
 
 import py
-from pypy.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\
+from pypy.jit.metainterp.history import BoxInt, ConstInt,\
      BoxPtr, ConstPtr, LoopToken, BasicFailDescr
 from pypy.jit.metainterp.resoperation import rop, ResOperation
 from pypy.jit.backend.llsupport.descr import GcCache

Modified: pypy/release/1.3.x/pypy/jit/codewriter/support.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/codewriter/support.py	(original)
+++ pypy/release/1.3.x/pypy/jit/codewriter/support.py	Sun Jun 13 00:12:31 2010
@@ -16,7 +16,6 @@
 from pypy.annotation.policy import AnnotatorPolicy
 from pypy.annotation import model as annmodel
 from pypy.rpython.annlowlevel import MixLevelHelperAnnotator
-from pypy.rpython.extregistry import ExtRegistryEntry
 from pypy.jit.metainterp.typesystem import deref
 from pypy.rlib import rgc
 

Modified: pypy/release/1.3.x/pypy/jit/codewriter/test/test_flatten.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/codewriter/test/test_flatten.py	(original)
+++ pypy/release/1.3.x/pypy/jit/codewriter/test/test_flatten.py	Sun Jun 13 00:12:31 2010
@@ -715,3 +715,12 @@
             uint_le %i2, $456L -> %i3
             int_return %i3
         """, transform=True)
+
+    def test_int_between(self):
+        from pypy.rpython.lltypesystem.lloperation import llop
+        def f(n, m, p):
+            return llop.int_between(lltype.Bool, n, m, p)
+        self.encoding_test(f, [5, 6, 7], """
+            int_between %i0, %i1, %i2 -> %i3
+            int_return %i3
+        """, transform=True)

Modified: pypy/release/1.3.x/pypy/jit/metainterp/blackhole.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/metainterp/blackhole.py	(original)
+++ pypy/release/1.3.x/pypy/jit/metainterp/blackhole.py	Sun Jun 13 00:12:31 2010
@@ -475,6 +475,9 @@
     @arguments("i", returns="i")
     def bhimpl_int_is_true(a):
         return bool(a)
+    @arguments("i", "i", "i", returns="i")
+    def bhimpl_int_between(a, b, c):
+        return a <= b < c
 
     @arguments("i", "i", returns="i")
     def bhimpl_uint_lt(a, b):

Modified: pypy/release/1.3.x/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/release/1.3.x/pypy/jit/metainterp/pyjitpl.py	Sun Jun 13 00:12:31 2010
@@ -315,6 +315,16 @@
         if value:
             self.pc = target
 
+    @arguments("box", "box", "box")
+    def opimpl_int_between(self, b1, b2, b3):
+        b5 = self.execute(rop.INT_SUB, b3, b1)
+        if isinstance(b5, ConstInt) and b5.getint() == 1:
+            # the common case of int_between(a, b, a+1) turns into just INT_EQ
+            return self.execute(rop.INT_EQ, b2, b1)
+        else:
+            b4 = self.execute(rop.INT_SUB, b2, b1)
+            return self.execute(rop.UINT_LT, b4, b5)
+
     @arguments("box", "descr", "orgpc")
     def opimpl_switch(self, valuebox, switchdict, orgpc):
         box = self.implement_guard_value(orgpc, valuebox)

Modified: pypy/release/1.3.x/pypy/jit/metainterp/test/test_basic.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/metainterp/test/test_basic.py	(original)
+++ pypy/release/1.3.x/pypy/jit/metainterp/test/test_basic.py	Sun Jun 13 00:12:31 2010
@@ -145,6 +145,9 @@
 
     def check_operations_history(self, expected=None, **isns):
         # this can be used after interp_operations
+        if expected is not None:
+            expected = dict(expected)
+            expected['jump'] = 1
         self.metainterp.staticdata.stats.check_history(expected, **isns)
 
 
@@ -561,6 +564,53 @@
                                       int_le=0, uint_le=1,
                                       int_sub=1)
 
+    def test_int_between(self):
+        #
+        def check(arg1, arg2, arg3, expect_result, **expect_operations):
+            from pypy.rpython.lltypesystem import lltype
+            from pypy.rpython.lltypesystem.lloperation import llop
+            loc = locals().copy()
+            exec py.code.Source("""
+                def f(n, m, p):
+                    arg1 = %(arg1)s
+                    arg2 = %(arg2)s
+                    arg3 = %(arg3)s
+                    return llop.int_between(lltype.Bool, arg1, arg2, arg3)
+            """ % locals()).compile() in loc
+            res = self.interp_operations(loc['f'], [5, 6, 7])
+            assert res == expect_result
+            self.check_operations_history(expect_operations)
+        #
+        check('n', 'm', 'p', True,  int_sub=2, uint_lt=1)
+        check('n', 'p', 'm', False, int_sub=2, uint_lt=1)
+        #
+        check('n', 'm', 6, False, int_sub=2, uint_lt=1)
+        #
+        check('n', 4, 'p', False, int_sub=2, uint_lt=1)
+        check('n', 5, 'p', True,  int_sub=2, uint_lt=1)
+        check('n', 8, 'p', False, int_sub=2, uint_lt=1)
+        #
+        check('n', 6, 7, True, int_sub=2, uint_lt=1)
+        #
+        check(-2, 'n', 'p', True,  int_sub=2, uint_lt=1)
+        check(-2, 'm', 'p', True,  int_sub=2, uint_lt=1)
+        check(-2, 'p', 'm', False, int_sub=2, uint_lt=1)
+        #check(0, 'n', 'p', True,  uint_lt=1)   xxx implement me
+        #check(0, 'm', 'p', True,  uint_lt=1)
+        #check(0, 'p', 'm', False, uint_lt=1)
+        #
+        check(2, 'n', 6, True,  int_sub=1, uint_lt=1)
+        check(2, 'm', 6, False, int_sub=1, uint_lt=1)
+        check(2, 'p', 6, False, int_sub=1, uint_lt=1)
+        check(5, 'n', 6, True,  int_eq=1)    # 6 == 5+1
+        check(5, 'm', 6, False, int_eq=1)    # 6 == 5+1
+        #
+        check(2, 6, 'm', False, int_sub=1, uint_lt=1)
+        check(2, 6, 'p', True,  int_sub=1, uint_lt=1)
+        #
+        check(2, 40, 6,  False)
+        check(2, 40, 60, True)
+
     def test_getfield(self):
         class A:
             pass

Modified: pypy/release/1.3.x/pypy/jit/metainterp/test/test_loop.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/metainterp/test/test_loop.py	(original)
+++ pypy/release/1.3.x/pypy/jit/metainterp/test/test_loop.py	Sun Jun 13 00:12:31 2010
@@ -2,7 +2,6 @@
 from pypy.rlib.jit import JitDriver, OPTIMIZER_SIMPLE, OPTIMIZER_FULL
 from pypy.rlib.objectmodel import compute_hash
 from pypy.jit.metainterp.warmspot import ll_meta_interp, get_stats
-from pypy.rpython.lltypesystem import lltype
 from pypy.jit.metainterp.test.test_basic import LLJitMixin, OOJitMixin
 from pypy.jit.codewriter.policy import StopAtXPolicy
 from pypy.jit.metainterp.resoperation import rop

Modified: pypy/release/1.3.x/pypy/jit/metainterp/test/test_recursive.py
==============================================================================
--- pypy/release/1.3.x/pypy/jit/metainterp/test/test_recursive.py	(original)
+++ pypy/release/1.3.x/pypy/jit/metainterp/test/test_recursive.py	Sun Jun 13 00:12:31 2010
@@ -180,7 +180,6 @@
             py.test.fail("DID NOT RAISE")
 
     def test_guard_failure_in_inlined_function(self):
-        from pypy.rpython.annlowlevel import hlstr
         def p(pc, code):
             code = hlstr(code)
             return "%s %d %s" % (code, pc, code[pc])
@@ -217,7 +216,6 @@
         assert res == 0
 
     def test_guard_failure_and_then_exception_in_inlined_function(self):
-        from pypy.rpython.annlowlevel import hlstr
         def p(pc, code):
             code = hlstr(code)
             return "%s %d %s" % (code, pc, code[pc])
@@ -261,7 +259,6 @@
         assert res == main(1000)
 
     def test_exception_in_inlined_function(self):
-        from pypy.rpython.annlowlevel import hlstr
         def p(pc, code):
             code = hlstr(code)
             return "%s %d %s" % (code, pc, code[pc])
@@ -307,7 +304,6 @@
         # this passes, if the blackholing shortcut for calls is turned off
         # it fails, it is very delicate in terms of parameters,
         # bridge/loop creation order
-        from pypy.rpython.annlowlevel import hlstr
         def p(pc, code):
             code = hlstr(code)
             return "%s %d %s" % (code, pc, code[pc])

Modified: pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_functions.py
==============================================================================
--- pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_functions.py	(original)
+++ pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_functions.py	Sun Jun 13 00:12:31 2010
@@ -210,7 +210,7 @@
         result = f(byref(c_int(99)))
         assert not result.contents == 99
 
-    def test_errors(self):
+    def test_errors_1(self):
         f = dll._testfunc_p_p
         f.restype = c_int
 
@@ -305,7 +305,7 @@
 
         assert 13577625587 == f(1000000000000, cb)
 
-    def test_errors(self):
+    def test_errors_2(self):
         raises(AttributeError, getattr, dll, "_xxx_yyy")
         raises(ValueError, c_int.in_dll, dll, "_xxx_yyy")
 

Modified: pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_unicode.py
==============================================================================
--- pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_unicode.py	(original)
+++ pypy/release/1.3.x/pypy/lib/app_test/ctypes_tests/test_unicode.py	Sun Jun 13 00:12:31 2010
@@ -90,7 +90,7 @@
             assert func(u"abc") == "abc"
             assert func(u"äöüß") == ""
 
-        def test_ascii_replace(self):
+        def test_ascii_replace_2(self):
             ctypes.set_conversion_mode("ascii", "replace")
             assert func("abc") == "abc"
             assert func(u"abc") == "abc"

Modified: pypy/release/1.3.x/pypy/lib/app_test/test_functools.py
==============================================================================
--- pypy/release/1.3.x/pypy/lib/app_test/test_functools.py	(original)
+++ pypy/release/1.3.x/pypy/lib/app_test/test_functools.py	Sun Jun 13 00:12:31 2010
@@ -31,7 +31,7 @@
         p = self.thetype(map, lambda x: x*10)
         assert p([1,2,3,4]) == [10, 20, 30, 40]
 
-    def test_attributes(self):
+    def test_attributes_1(self):
         p = self.thetype(capture, 1, 2, a=10, b=20)
         # attributes should be readable
         assert p.func == capture
@@ -118,7 +118,7 @@
         py.test.raises(ZeroDivisionError, self.thetype(f), 1, 0)
         py.test.raises(ZeroDivisionError, self.thetype(f, y=0), 1)
 
-    def test_attributes(self):
+    def test_attributes_2(self):
         p = self.thetype(hex)
         try:
             del p.__dict__

Modified: pypy/release/1.3.x/pypy/module/__builtin__/functional.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/__builtin__/functional.py	(original)
+++ pypy/release/1.3.x/pypy/module/__builtin__/functional.py	Sun Jun 13 00:12:31 2010
@@ -187,13 +187,15 @@
         cont = False
         args_w = [space.w_None] * num_iterators
         for i in range(num_iterators):
-            try:
-                args_w[i] = space.next(iterators_w[i])
-            except OperationError, e:
-                if not e.match(space, space.w_StopIteration):
-                    raise
-            else:
-                cont = True
+            if iterators_w[i] is not None:
+                try:
+                    args_w[i] = space.next(iterators_w[i])
+                except OperationError, e:
+                    if not e.match(space, space.w_StopIteration):
+                        raise
+                    iterators_w[i] = None
+                else:
+                    cont = True
         if cont:
             w_args = space.newtuple(args_w)
             if none_func:

Modified: pypy/release/1.3.x/pypy/module/__builtin__/test/test_classobj.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/__builtin__/test/test_classobj.py	(original)
+++ pypy/release/1.3.x/pypy/module/__builtin__/test/test_classobj.py	Sun Jun 13 00:12:31 2010
@@ -477,7 +477,7 @@
         assert a is a1
         assert a.l == [1, 2]
 
-    def test_cmp(self):
+    def test_cmp_and_coerce(self):
         class A:
             def __coerce__(self, other):
                 return (1, 2)

Modified: pypy/release/1.3.x/pypy/module/__builtin__/test/test_functional.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/__builtin__/test/test_functional.py	(original)
+++ pypy/release/1.3.x/pypy/module/__builtin__/test/test_functional.py	Sun Jun 13 00:12:31 2010
@@ -48,16 +48,35 @@
       b = [ 2, 3, 4, 5, 6]
       assert map(None, a, b) == [('1', 2), (2, 3), (3, 4), ('b', 5), (None, 6)]
 
-   def test_map_multiply(self):
+   def test_map_add(self):
       a = [1, 2, 3, 4]
       b = [0, 1, 1, 1]
-      assert map(lambda x, y: x+y, a, b) == [1, 2, 4, 5]
+      assert map(lambda x, y: x+y, a, b) == [1, 3, 4, 5]
 
-   def test_map_multiply(self):
+   def test_map_first_item(self):
       a = [1, 2, 3, 4, 5]
       b = []
       assert map(lambda x, y: x, a, b) == a
 
+   def test_map_iterables(self):
+      class A(object):
+         def __init__(self, n):
+            self.n = n
+         def __iter__(self):
+            return B(self.n)
+      class B(object):
+         def __init__(self, n):
+            self.n = n
+         def next(self):
+            self.n -= 1
+            if self.n == 0: raise StopIteration
+            return self.n
+      result = map(None, A(3), A(8))
+      # this also checks that B.next() is not called any more after it
+      # raised StopIteration once
+      assert result == [(2, 7), (1, 6), (None, 5), (None, 4),
+                        (None, 3), (None, 2), (None, 1)]
+
 class AppTestZip:
    def test_one_list(self):
       assert zip([1,2,3]) == [(1,), (2,), (3,)]

Modified: pypy/release/1.3.x/pypy/module/_codecs/test/test_codecs.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/_codecs/test/test_codecs.py	(original)
+++ pypy/release/1.3.x/pypy/module/_codecs/test/test_codecs.py	Sun Jun 13 00:12:31 2010
@@ -373,7 +373,7 @@
         decoded = _codecs.unicode_escape_decode(s)[0]
         assert decoded == ''
 
-    def test_charmap_decode(self):
+    def test_charmap_decode_1(self):
         import codecs
         res = codecs.charmap_decode("\x00\x01\x02", "replace", u"ab")
         assert res == (u"ab\ufffd", 3)
@@ -525,7 +525,7 @@
     def test_charmap_encode(self):
         assert 'xxx'.encode('charmap') == 'xxx'
 
-    def test_charmap_decode(self):
+    def test_charmap_decode_2(self):
         assert 'foo'.decode('charmap') == 'foo'
 
     def test_utf7_start_end_in_exception(self):

Modified: pypy/release/1.3.x/pypy/module/_file/test/test_file_extra.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/_file/test/test_file_extra.py	(original)
+++ pypy/release/1.3.x/pypy/module/_file/test/test_file_extra.py	Sun Jun 13 00:12:31 2010
@@ -71,12 +71,6 @@
         inputlines = list(self.file)
         assert inputlines == self.expected_lines
 
-    def test_repr(self):
-        r = repr(self.file)
-        assert r.find('open file') >= 0
-        assert r.find(self.file.name) >= 0
-        assert r.find(self.file.mode) >= 0
-
     def test_isatty(self):
         assert not self.file.isatty()
 

Modified: pypy/release/1.3.x/pypy/module/cpyext/__init__.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/cpyext/__init__.py	(original)
+++ pypy/release/1.3.x/pypy/module/cpyext/__init__.py	Sun Jun 13 00:12:31 2010
@@ -64,7 +64,7 @@
 import pypy.module.cpyext.sliceobject
 import pypy.module.cpyext.stubsactive
 import pypy.module.cpyext.pystate
-import pypy.module.cpyext.datetime
+import pypy.module.cpyext.cdatetime
 import pypy.module.cpyext.complexobject
 import pypy.module.cpyext.weakrefobject
 import pypy.module.cpyext.funcobject

Modified: pypy/release/1.3.x/pypy/module/cpyext/api.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/cpyext/api.py	(original)
+++ pypy/release/1.3.x/pypy/module/cpyext/api.py	Sun Jun 13 00:12:31 2010
@@ -315,7 +315,7 @@
     '_Py_TrueStruct#': ('PyObject*', 'space.w_True'),
     '_Py_ZeroStruct#': ('PyObject*', 'space.w_False'),
     '_Py_NotImplementedStruct#': ('PyObject*', 'space.w_NotImplemented'),
-    'PyDateTimeAPI': ('PyDateTime_CAPI*', 'cpyext.datetime.build_datetime_api(space)'),
+    'PyDateTimeAPI': ('PyDateTime_CAPI*', 'cpyext.cdatetime.build_datetime_api(space)'),
     }
 FORWARD_DECLS = []
 INIT_FUNCTIONS = []
@@ -361,7 +361,7 @@
 
 def get_structtype_for_ctype(ctype):
     from pypy.module.cpyext.typeobjectdefs import PyTypeObjectPtr
-    from pypy.module.cpyext.datetime import PyDateTime_CAPI
+    from pypy.module.cpyext.cdatetime import PyDateTime_CAPI
     return {"PyObject*": PyObject, "PyTypeObject*": PyTypeObjectPtr,
             "PyDateTime_CAPI*": lltype.Ptr(PyDateTime_CAPI)}[ctype]
 
@@ -801,7 +801,7 @@
         if sys.platform == "win32":
             # '%s' undefined; assuming extern returning int
             compile_extra.append("/we4013")
-        else:
+        elif sys.platform == 'linux2':
             compile_extra.append("-Werror=implicit-function-declaration")
         export_symbols_eci.append('pypyAPI')
     else:

Modified: pypy/release/1.3.x/pypy/module/cpyext/test/test_cpyext.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/cpyext/test/test_cpyext.py	(original)
+++ pypy/release/1.3.x/pypy/module/cpyext/test/test_cpyext.py	Sun Jun 13 00:12:31 2010
@@ -386,6 +386,7 @@
         the latter is added to `sys.modules` for the `"apple.banana"` key.
         """
         # Build the extensions.
+        import cpyext
         banana = self.compile_module(
             "apple.banana", separate_module_files=[self.here + 'banana.c'])
         self.record_imported_module("apple.banana")

Modified: pypy/release/1.3.x/pypy/module/imp/test/test_app.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/imp/test/test_app.py	(original)
+++ pypy/release/1.3.x/pypy/module/imp/test/test_app.py	Sun Jun 13 00:12:31 2010
@@ -71,7 +71,8 @@
         import test_imp_extra_AUTO1
         assert mod is test_imp_extra_AUTO1
 
-    def test_load_module_pyc(self):
+    def test_load_module_pyc_1(self):
+        import os
         fn = self._pyc_file()
         try:
             descr = ('.pyc', 'rb', self.imp.PY_COMPILED)
@@ -91,7 +92,7 @@
         import test_imp_extra_AUTO3
         assert mod is test_imp_extra_AUTO3
 
-    def test_load_module_pyc(self):
+    def test_load_module_pyc_2(self):
         import os
         fn = self._pyc_file()
         try:

Modified: pypy/release/1.3.x/pypy/module/itertools/test/test_itertools.py
==============================================================================
--- pypy/release/1.3.x/pypy/module/itertools/test/test_itertools.py	(original)
+++ pypy/release/1.3.x/pypy/module/itertools/test/test_itertools.py	Sun Jun 13 00:12:31 2010
@@ -130,7 +130,7 @@
 
         raises(StopIteration, it.next)
 
-    def test_takewhile_wrongargs(self):
+    def test_dropwhile_wrongargs(self):
         import itertools
 
         it = itertools.dropwhile(None, [1])

Modified: pypy/release/1.3.x/pypy/rlib/parsing/test/test_regexparse.py
==============================================================================
--- pypy/release/1.3.x/pypy/rlib/parsing/test/test_regexparse.py	(original)
+++ pypy/release/1.3.x/pypy/rlib/parsing/test/test_regexparse.py	Sun Jun 13 00:12:31 2010
@@ -24,7 +24,7 @@
     assert r.recognize("kjsadfq3jlflASDF@#$")
     assert r.recognize("vka afj ASF# A")
 
-def test_quoted():
+def test_quoted_1():
     r = make_runner("\\(*")
     assert r.recognize("(")
     assert not r.recognize("\\(")
@@ -77,7 +77,7 @@
     assert not r.recognize("a")
     assert not r.recognize("c")
 
-def test_quoted():
+def test_quoted_2():
     r = make_runner('\\[|\\]|\\|')
     assert r.recognize("[")
     assert r.recognize("|")

Modified: pypy/release/1.3.x/pypy/rlib/rgc.py
==============================================================================
--- pypy/release/1.3.x/pypy/rlib/rgc.py	(original)
+++ pypy/release/1.3.x/pypy/rlib/rgc.py	Sun Jun 13 00:12:31 2010
@@ -201,7 +201,6 @@
     def specialize_call(self, hop):
         from pypy.rpython.lltypesystem import lltype
         from pypy.rpython.memory.gc.base import ARRAY_TYPEID_MAP
-        from pypy.rpython.lltypesystem import lltype
         hop.exception_is_here()
         return hop.genop('gc_heap_stats', [], resulttype=hop.r_result)
 

Modified: pypy/release/1.3.x/pypy/rlib/test/test_rbigint.py
==============================================================================
--- pypy/release/1.3.x/pypy/rlib/test/test_rbigint.py	(original)
+++ pypy/release/1.3.x/pypy/rlib/test/test_rbigint.py	Sun Jun 13 00:12:31 2010
@@ -55,8 +55,6 @@
                 assert r1.tolong() == r2
 
     def test_touint(self):
-        import sys
-        from pypy.rlib.rarithmetic import r_uint
         result = r_uint(sys.maxint + 42)
         rl = rbigint.fromint(sys.maxint).add(rbigint.fromint(42))
         assert rl.touint() == result

Modified: pypy/release/1.3.x/pypy/rlib/test/test_rmmap.py
==============================================================================
--- pypy/release/1.3.x/pypy/rlib/test/test_rmmap.py	(original)
+++ pypy/release/1.3.x/pypy/rlib/test/test_rmmap.py	Sun Jun 13 00:12:31 2010
@@ -3,7 +3,6 @@
 from pypy.rpython.test.test_llinterp import interpret
 from pypy.rlib import rmmap as mmap
 from pypy.rlib.rmmap import RTypeError, RValueError, alloc, free
-import sys
 
 class TestMMap:
     def setup_class(cls):

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/llarena.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/llarena.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/llarena.py	Sun Jun 13 00:12:31 2010
@@ -1,5 +1,5 @@
 import array, weakref
-from pypy.rpython.lltypesystem import lltype, llmemory
+from pypy.rpython.lltypesystem import llmemory
 
 # An "arena" is a large area of memory which can hold a number of
 # objects, not necessarily all of the same type or size.  It's used by

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/lloperation.py	Sun Jun 13 00:12:31 2010
@@ -227,6 +227,8 @@
     'int_rshift':           LLOp(canfold=True),
     'int_xor':              LLOp(canfold=True),
 
+    'int_between':          LLOp(canfold=True),   # a <= b < c
+
     'int_add_ovf':          LLOp(canraise=(OverflowError,), tryfold=True),
     'int_add_nonneg_ovf':   LLOp(canraise=(OverflowError,), tryfold=True),
               # ^^^ more efficient version when 2nd arg is nonneg

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/lltype.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/lltype.py	Sun Jun 13 00:12:31 2010
@@ -12,7 +12,6 @@
 from pypy.lib.identity_dict import identity_dict
 from types import NoneType
 from sys import maxint
-import struct
 import weakref
 
 TLS = tlsobject()

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/opimpl.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/opimpl.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/opimpl.py	Sun Jun 13 00:12:31 2010
@@ -197,6 +197,12 @@
     assert isinstance(y, int)
     return intmask(x - y)
 
+def op_int_between(a, b, c):
+    assert lltype.typeOf(a) is lltype.Signed
+    assert lltype.typeOf(b) is lltype.Signed
+    assert lltype.typeOf(c) is lltype.Signed
+    return a <= b < c
+
 def op_int_and(x, y):
     if not isinstance(x, int):
         from pypy.rpython.lltypesystem import llgroup

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/rclass.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/rclass.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/rclass.py	Sun Jun 13 00:12:31 2010
@@ -14,7 +14,7 @@
      cast_pointer, cast_ptr_to_int, castable, nullptr, \
      RuntimeTypeInfo, getRuntimeTypeInfo, typeOf, \
      Array, Char, Void, \
-     FuncType, Bool, Signed, functionptr, FuncType, PyObject
+     FuncType, Bool, Signed, functionptr, PyObject
 from pypy.rpython.lltypesystem import lltype
 from pypy.rpython.robject import PyObjRepr, pyobj_repr
 from pypy.rpython.extregistry import ExtRegistryEntry
@@ -22,6 +22,7 @@
 from pypy.rlib.rarithmetic import intmask
 from pypy.rlib import objectmodel
 from pypy.lib.identity_dict import identity_dict
+from pypy.rpython.lltypesystem.lloperation import llop
 
 #
 #  There is one "vtable" per user class, with the following structure:
@@ -645,10 +646,12 @@
     return cast_pointer(OBJECTPTR, obj).typeptr
 
 def ll_issubclass(subcls, cls):
-    return cls.subclassrange_min <= subcls.subclassrange_min <= cls.subclassrange_max
+    return llop.int_between(Bool, cls.subclassrange_min,
+                                  subcls.subclassrange_min,
+                                  cls.subclassrange_max)
 
 def ll_issubclass_const(subcls, minid, maxid):
-    return minid <= subcls.subclassrange_min <= maxid
+    return llop.int_between(Bool, minid, subcls.subclassrange_min, maxid)
 
 
 def ll_isinstance(obj, cls): # obj should be cast to OBJECT or NONGCOBJECT

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/rffi.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/rffi.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/rffi.py	Sun Jun 13 00:12:31 2010
@@ -3,7 +3,7 @@
 from pypy.rpython.lltypesystem import lltype
 from pypy.rpython.lltypesystem import ll2ctypes
 from pypy.rpython.lltypesystem.llmemory import cast_adr_to_ptr, cast_ptr_to_adr
-from pypy.rpython.lltypesystem.llmemory import itemoffsetof, offsetof, raw_memcopy
+from pypy.rpython.lltypesystem.llmemory import itemoffsetof, raw_memcopy
 from pypy.annotation.model import lltype_to_annotation
 from pypy.tool.sourcetools import func_with_new_name
 from pypy.rlib.objectmodel import Symbolic, CDefinedIntSymbolic
@@ -11,7 +11,6 @@
 from pypy.rlib import rarithmetic, rgc
 from pypy.rpython.extregistry import ExtRegistryEntry
 from pypy.rlib.unroll import unrolling_iterable
-from pypy.tool.sourcetools import func_with_new_name
 from pypy.rpython.tool.rfficache import platform
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.rpython.annlowlevel import llhelper
@@ -785,7 +784,6 @@
         # the hint is present in structures probed by rffi_platform.
         size = tp._hints.get('size')
         if size is None:
-            from pypy.rpython.lltypesystem import llmemory
             size = llmemory.sizeof(tp)    # a symbolic result in this case
         return size
     if isinstance(tp, lltype.Ptr):
@@ -814,7 +812,6 @@
             if name == fieldname:
                 return fieldoffsets[index]
     # a symbolic result as a fallback
-    from pypy.rpython.lltypesystem import llmemory
     return llmemory.offsetof(STRUCT, fieldname)
 offsetof._annspecialcase_ = 'specialize:memo'
 

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_ll2ctypes.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_ll2ctypes.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_ll2ctypes.py	Sun Jun 13 00:12:31 2010
@@ -15,7 +15,6 @@
 from pypy.rpython.test.test_llinterp import interpret
 from pypy.annotation.annrpython import RPythonAnnotator
 from pypy.rpython.rtyper import RPythonTyper
-from pypy.tool.udir import udir
 
 class TestLL2Ctypes(object):
 

Modified: pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_lltype.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_lltype.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/lltypesystem/test/test_lltype.py	Sun Jun 13 00:12:31 2010
@@ -722,7 +722,6 @@
 
 def test_name_clash():
     import re
-    from pypy.rpython.lltypesystem import lltype
     fn = lltype.__file__
     if fn.lower().endswith('pyc') or fn.lower().endswith('pyo'):
         fn = fn[:-1]

Modified: pypy/release/1.3.x/pypy/rpython/memory/gc/generation.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/memory/gc/generation.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/memory/gc/generation.py	Sun Jun 13 00:12:31 2010
@@ -720,7 +720,7 @@
         return pos
 
 elif sys.platform == 'darwin':
-    from pypy.rpython.lltypesystem import lltype, rffi
+    from pypy.rpython.lltypesystem import rffi
 
     sysctlbyname = rffi.llexternal('sysctlbyname',
                                    [rffi.CCHARP, rffi.VOIDP, rffi.SIZE_TP,

Modified: pypy/release/1.3.x/pypy/rpython/memory/gc/marksweep.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/memory/gc/marksweep.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/memory/gc/marksweep.py	Sun Jun 13 00:12:31 2010
@@ -242,7 +242,6 @@
         # 3. walk the list of objects-with-del and for the ones not marked:
         #    call __del__, move the object to the list of object-without-del
         import time
-        from pypy.rpython.lltypesystem.lloperation import llop
         debug_start("gc-collect")
         start_time = time.time()
         self.collect_in_progress = True

Modified: pypy/release/1.3.x/pypy/rpython/normalizecalls.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/normalizecalls.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/normalizecalls.py	Sun Jun 13 00:12:31 2010
@@ -292,6 +292,13 @@
         else:
             return cmp(self.orderwitness, other.orderwitness)
 
+    # support for implementing int_between: (a<=b<c) with (b-a<c-a)
+    # see pypy.jit.metainterp.pyjitpl.opimpl_int_between
+    def __sub__(self, other):
+        return self.compute_fn() - other
+    def __rsub__(self, other):
+        return other - self.compute_fn()
+
     def compute_fn(self):
         if self.value is None:
             self.peers.sort()

Modified: pypy/release/1.3.x/pypy/rpython/numpy/test/test_array.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/numpy/test/test_array.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/numpy/test/test_array.py	Sun Jun 13 00:12:31 2010
@@ -3,7 +3,8 @@
 """
 
 import py
-numpy = py.test.importorskip("numpy")
+py.test.skip("numpy - broken")
+
 import pypy.rpython.numpy.implementation
 from pypy.annotation import model as annmodel
 from pypy.annotation.model import SomeObject, SomeInteger, SomeChar, SomeTuple
@@ -270,7 +271,7 @@
         assert s.ndim == 1
         assert s.typecode == 'l'
 
-    def test_annotate_indexing(self):
+    def test_annotate_indexing_2(self):
         def f():
             a = numpy.empty((4,3), dtype='i')
             c = a[:,0]

Modified: pypy/release/1.3.x/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/ootypesystem/ootype.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/ootypesystem/ootype.py	Sun Jun 13 00:12:31 2010
@@ -3,7 +3,7 @@
 from pypy.rpython.lltypesystem.lltype import LowLevelType, Signed, Unsigned, Float, Char
 from pypy.rpython.lltypesystem.lltype import Bool, Void, UniChar, typeOf, \
         Primitive, isCompatibleType, enforce, saferecursive, SignedLongLong, UnsignedLongLong
-from pypy.rpython.lltypesystem.lltype import frozendict, isCompatibleType
+from pypy.rpython.lltypesystem.lltype import frozendict
 from pypy.rpython.lltypesystem.lltype import identityhash
 from pypy.rlib.rarithmetic import intmask
 from pypy.rlib import objectmodel

Modified: pypy/release/1.3.x/pypy/rpython/ootypesystem/rootype.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/ootypesystem/rootype.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/ootypesystem/rootype.py	Sun Jun 13 00:12:31 2010
@@ -157,13 +157,6 @@
     def __init__(self, METHODTYPE):
         self.lowleveltype = METHODTYPE
 
-    def rtype_simple_call(self, hop):
-        vlist = hop.inputargs(*hop.args_r)
-        cgraphs = hop.inputconst(ootype.Void, None)
-        vlist.append(cgraphs)
-        hop.exception_is_here()
-        return hop.genop("indirect_call", vlist, resulttype = hop.r_result.lowleveltype)
-
     def rtype_call_args(self, hop):
         from pypy.rpython.rbuiltin import call_args_expand
         hop, _ = call_args_expand(hop, takes_kwds=False)

Modified: pypy/release/1.3.x/pypy/rpython/ootypesystem/test/test_oolist.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/ootypesystem/test/test_oolist.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/ootypesystem/test/test_oolist.py	Sun Jun 13 00:12:31 2010
@@ -122,14 +122,6 @@
         res = interpret(f, [3], type_system="ootype")
         assert res == 3 
 
-    def test_initialize(self):
-        def f(x):
-            l = [1, 2]
-            l.append(x)
-            return l[2]
-        res = interpret(f, [3], type_system="ootype")
-        assert res == 3 
-
     def test_listtype_explosion(self):
         def f(x):
             l1 = [x]

Modified: pypy/release/1.3.x/pypy/rpython/rbuiltin.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/rbuiltin.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/rbuiltin.py	Sun Jun 13 00:12:31 2010
@@ -529,8 +529,6 @@
 # _________________________________________________________________
 # memory addresses
 
-from pypy.rpython.lltypesystem import llmemory
-
 def rtype_raw_malloc(hop):
     v_size, = hop.inputargs(lltype.Signed)
     return hop.genop('raw_malloc', [v_size], resulttype=llmemory.Address)

Modified: pypy/release/1.3.x/pypy/rpython/test/test_llinterp.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/test/test_llinterp.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/test/test_llinterp.py	Sun Jun 13 00:12:31 2010
@@ -307,7 +307,6 @@
     assert res._obj.value == 3L
 
 def test_ovf():
-    import sys
     def f(x):
         try:
             return ovfcheck(sys.maxint + x)
@@ -328,7 +327,6 @@
     assert res == 15
 
 def test_floordiv_ovf_zer():
-    import sys
     def f(x):
         try:
             return ovfcheck((-sys.maxint - 1) // x)
@@ -344,7 +342,6 @@
     assert res == (-sys.maxint - 1) // 30
 
 def test_mod_ovf_zer():
-    import sys
     def f(x):
         try:
             return ovfcheck((-sys.maxint - 1) % x)

Modified: pypy/release/1.3.x/pypy/rpython/test/test_rfloat.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/test/test_rfloat.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/test/test_rfloat.py	Sun Jun 13 00:12:31 2010
@@ -77,7 +77,6 @@
         assert res == fn(2.34) 
 
     def test_longlong_conversion(self):
-        import sys
         def fn(f):
             return r_longlong(f)
 

Modified: pypy/release/1.3.x/pypy/rpython/test/test_rint.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/test/test_rint.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/test/test_rint.py	Sun Jun 13 00:12:31 2010
@@ -169,7 +169,6 @@
         assert res == 0
 
     def test_truediv(self):
-        import operator
         def f(n, m):
             return operator.truediv(n, m)
         res = self.interpret(f, [20, 4])

Modified: pypy/release/1.3.x/pypy/rpython/test/test_rlist.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/test/test_rlist.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/test/test_rlist.py	Sun Jun 13 00:12:31 2010
@@ -10,7 +10,6 @@
 from pypy.rpython.lltypesystem import rlist as ll_rlist
 from pypy.rpython.ootypesystem import rlist as oo_rlist
 from pypy.rpython.rint import signed_repr
-from pypy.translator.translator import TranslationContext
 from pypy.objspace.flow.model import Constant, Variable
 from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
 
@@ -1070,7 +1069,7 @@
         assert res == 0
 
 
-    def test_getitem_exc(self):
+    def test_getitem_exc_1(self):
         def f(x):
             l = [1]
             return l[x]
@@ -1115,7 +1114,7 @@
         res = self.interpret(f, [0])
         assert res == 1
         
-    def test_getitem_exc(self):
+    def test_getitem_exc_2(self):
         def f(x):
             l = [1]
             return l[x]

Modified: pypy/release/1.3.x/pypy/rpython/test/test_rvirtualizable2.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/test/test_rvirtualizable2.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/test/test_rvirtualizable2.py	Sun Jun 13 00:12:31 2010
@@ -311,7 +311,7 @@
         assert res == 2323
 
     def test_access_directly_stop_at_dont_look_inside(self):
-        from pypy.rlib.jit import hint, dont_look_inside
+        from pypy.rlib.jit import dont_look_inside
 
         class A:
             _virtualizable2_ = ['x']

Modified: pypy/release/1.3.x/pypy/rpython/tool/rffi_platform.py
==============================================================================
--- pypy/release/1.3.x/pypy/rpython/tool/rffi_platform.py	(original)
+++ pypy/release/1.3.x/pypy/rpython/tool/rffi_platform.py	Sun Jun 13 00:12:31 2010
@@ -752,7 +752,7 @@
                            'struct sockaddr_in'
                            sin_port  INT
     """
-    import sys, getopt
+    import getopt
     opts, args = getopt.gnu_getopt(sys.argv[1:], 'h:')
     if not args:
         print >> sys.stderr, doc

Modified: pypy/release/1.3.x/pypy/tool/sourcetools.py
==============================================================================
--- pypy/release/1.3.x/pypy/tool/sourcetools.py	(original)
+++ pypy/release/1.3.x/pypy/tool/sourcetools.py	Sun Jun 13 00:12:31 2010
@@ -129,7 +129,6 @@
     for name in names:
         if name not in kwargs:
             kwargs[name] = getattr(fromcode, name)
-    import new
     return new.code(
              kwargs['co_argcount'],
              kwargs['co_nlocals'],

Modified: pypy/release/1.3.x/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/release/1.3.x/pypy/translator/c/funcgen.py	(original)
+++ pypy/release/1.3.x/pypy/translator/c/funcgen.py	Sun Jun 13 00:12:31 2010
@@ -318,6 +318,7 @@
 
     def gen_op(self, op):
         macro = 'OP_%s' % op.opname.upper()
+        line = None
         if op.opname.startswith('gc_'):
             meth = getattr(self.gcpolicy, macro, None)
             if meth:
@@ -326,7 +327,7 @@
             meth = getattr(self, macro, None)
             if meth:
                 line = meth(op)
-        if meth is None:
+        if line is None:
             lst = [self.expr(v) for v in op.args]
             lst.append(self.expr(op.result))
             line = '%s(%s);' % (macro, ', '.join(lst))
@@ -849,5 +850,16 @@
         return 'PYPY_DEBUG_CATCH_EXCEPTION("%s", %s, %s);' % (
             self.getdebugfunctionname(), gottype, ' || '.join(exprs))
 
+    def OP_INT_BETWEEN(self, op):
+        if (isinstance(op.args[0], Constant) and
+            isinstance(op.args[2], Constant) and
+            op.args[2].value - op.args[0].value == 1):
+            # (a <= b < a+1) ----> (b == a)
+            return '%s = (%s == %s);  /* was INT_BETWEEN */' % (
+                self.expr(op.result),
+                self.expr(op.args[1]),
+                self.expr(op.args[0]))
+        else:
+            return None    # use the default
 
 assert not USESLOTS or '__dict__' not in dir(FunctionCodeGenerator)

Modified: pypy/release/1.3.x/pypy/translator/c/src/int.h
==============================================================================
--- pypy/release/1.3.x/pypy/translator/c/src/int.h	(original)
+++ pypy/release/1.3.x/pypy/translator/c/src/int.h	Sun Jun 13 00:12:31 2010
@@ -47,6 +47,14 @@
 #define OP_INT_LT(x,y,r)	  r = ((x) <  (y))
 #define OP_INT_GE(x,y,r)	  r = ((x) >= (y))
 
+/* Implement INT_BETWEEN by optimizing for the common case where a and c
+   are constants (the 2nd subtraction below is then constant-folded), or
+   for the case of a == 0 (both subtractions are then constant-folded).
+   Note that the following line only works if a <= c in the first place,
+   which we assume is true. */
+#define OP_INT_BETWEEN(a,b,c,r)   r = (((unsigned long)b - (unsigned long)a) \
+                                     < ((unsigned long)c - (unsigned long)a))
+
 /* addition, subtraction */
 
 #define OP_INT_ADD(x,y,r)     r = (x) + (y)

Modified: pypy/release/1.3.x/pypy/translator/c/test/test_extfunc.py
==============================================================================
--- pypy/release/1.3.x/pypy/translator/c/test/test_extfunc.py	(original)
+++ pypy/release/1.3.x/pypy/translator/c/test/test_extfunc.py	Sun Jun 13 00:12:31 2010
@@ -221,13 +221,6 @@
     res = f1()
     assert res == os.getcwd()
 
-def test_strerror():
-    def does_stuff():
-        return os.strerror(2)
-    f1 = compile(does_stuff, [])
-    res = f1()
-    assert res == os.strerror(2)
-
 def test_system():
     def does_stuff(cmd):
         return os.system(cmd)

Modified: pypy/release/1.3.x/pypy/translator/c/test/test_typed.py
==============================================================================
--- pypy/release/1.3.x/pypy/translator/c/test/test_typed.py	(original)
+++ pypy/release/1.3.x/pypy/translator/c/test/test_typed.py	Sun Jun 13 00:12:31 2010
@@ -79,11 +79,6 @@
         nested_whiles = self.getcompiled(snippet.nested_whiles, [int, int])
         assert nested_whiles(5,3) == '!!!!!'
 
-    def test_call_five(self):
-        call_five = self.getcompiled(snippet.call_five, [int])
-        result = call_five()
-        assert result == [5]
-
     def test_call_unpack_56(self):
         call_unpack_56 = self.getcompiled(snippet.call_unpack_56, [])
         result = call_unpack_56()
@@ -116,13 +111,6 @@
         assert fn(4) == 789
         assert fn(5) == 101112
 
-    def test_get_set_del_slice(self):
-        fn = self.getcompiled(snippet.get_set_del_slice, [list])
-        l = list('abcdefghij')
-        result = fn(l)
-        assert l == [3, 'c', 8, 11, 'h', 9]
-        assert result == ([3, 'c'], [9], [11, 'h'])
-
     def test_type_conversion(self):
         # obfuscated test case specially for typer.insert_link_conversions()
         def type_conversion(n):



More information about the Pypy-commit mailing list