[pypy-svn] r74044 - in pypy/trunk/pypy: lib/app_test objspace/std rlib/test translator/backendopt

benjamin at codespeak.net benjamin at codespeak.net
Sun Apr 25 03:53:45 CEST 2010


Author: benjamin
Date: Sun Apr 25 03:53:43 2010
New Revision: 74044

Modified:
   pypy/trunk/pypy/lib/app_test/test_deque_extra.py
   pypy/trunk/pypy/objspace/std/dictmultiobject.py
   pypy/trunk/pypy/rlib/test/test_rope.py
   pypy/trunk/pypy/translator/backendopt/support.py
Log:
remove compatibility code for reversed and sorted

Modified: pypy/trunk/pypy/lib/app_test/test_deque_extra.py
==============================================================================
--- pypy/trunk/pypy/lib/app_test/test_deque_extra.py	(original)
+++ pypy/trunk/pypy/lib/app_test/test_deque_extra.py	Sun Apr 25 03:53:43 2010
@@ -1,10 +1,5 @@
 # Deque Tests
 
-# for passing the test on top of 2.3
-from py.builtin import reversed
-import pypy.lib.collections
-pypy.lib.collections.reversed = reversed
-
 
 n = 10
 class Test_deque:

Modified: pypy/trunk/pypy/objspace/std/dictmultiobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/dictmultiobject.py	(original)
+++ pypy/trunk/pypy/objspace/std/dictmultiobject.py	Sun Apr 25 03:53:43 2010
@@ -512,7 +512,7 @@
         self._dict_infos.append(self)
     def __repr__(self):
         args = []
-        for k in py.builtin.sorted(self.__dict__):
+        for k in sorted(self.__dict__):
             v = self.__dict__[k]
             if v != 0:
                 args.append('%s=%r'%(k, v))
@@ -613,7 +613,7 @@
 del DictInfo._dict_infos[-1]
 tmpl = 'os.write(fd, "%(attr)s" + ": " + str(info.%(attr)s) + "\\n")'
 bodySrc = []
-for attr in py.builtin.sorted(_example.__dict__):
+for attr in sorted(_example.__dict__):
     if attr == 'sig':
         continue
     bodySrc.append(tmpl%locals())

Modified: pypy/trunk/pypy/rlib/test/test_rope.py
==============================================================================
--- pypy/trunk/pypy/rlib/test/test_rope.py	(original)
+++ pypy/trunk/pypy/rlib/test/test_rope.py	Sun Apr 25 03:53:43 2010
@@ -223,7 +223,7 @@
 def test_reverse_iteration():
     rope, real_st = make_random_string(200)
     iter = ReverseItemIterator(rope)
-    for c in py.builtin.reversed(real_st):
+    for c in reversed(real_st):
         c2 = iter.nextchar()
         assert c2 == c
     py.test.raises(StopIteration, iter.nextchar)
@@ -236,12 +236,12 @@
 def test_reverse_iteration_unicode():
     rope, real_st = make_random_string(200, unicode=True)
     iter = ReverseItemIterator(rope)
-    for c in py.builtin.reversed(real_st):
+    for c in reversed(real_st):
         c2 = iter.nextunichar()
         assert c2 == c
     py.test.raises(StopIteration, iter.nextchar)
     iter = ReverseItemIterator(rope)
-    for c in py.builtin.reversed(real_st):
+    for c in reversed(real_st):
         c2 = iter.nextint()
         assert c2 == ord(c)
     py.test.raises(StopIteration, iter.nextchar)

Modified: pypy/trunk/pypy/translator/backendopt/support.py
==============================================================================
--- pypy/trunk/pypy/translator/backendopt/support.py	(original)
+++ pypy/trunk/pypy/translator/backendopt/support.py	Sun Apr 25 03:53:43 2010
@@ -151,7 +151,8 @@
 def compute_reachability(graph):
     reachable = {}
     blocks = list(graph.iterblocks())
-    for block in py.builtin.reversed(blocks): # this order should make the reuse path more likely
+    # Reversed order should make the reuse path more likely.
+    for block in reversed(blocks):
         reach = set()
         scheduled = [block]
         while scheduled:



More information about the Pypy-commit mailing list