Author: Alex Gaynor <[email protected]>
Branch:
Changeset: r70473:6a6e8602aa36
Date: 2014-04-05 11:47 -0700
http://bitbucket.org/pypy/pypy/changeset/6a6e8602aa36/
Log: Remove unused feature
diff --git a/rpython/flowspace/test/test_unroll.py
b/rpython/flowspace/test/test_unroll.py
--- a/rpython/flowspace/test/test_unroll.py
+++ b/rpython/flowspace/test/test_unroll.py
@@ -1,23 +1,10 @@
import operator
+
from rpython.flowspace.test.test_objspace import Base
-from rpython.rlib.unroll import unrolling_zero, unrolling_iterable
+from rpython.rlib.unroll import unrolling_iterable
+
class TestUnroll(Base):
-
- def test_unrolling_int(self):
- l = range(10)
- def f(tot):
- i = unrolling_zero
- while i < len(l):
- tot += l[i]
- i = i + 1
- return tot*2
- assert f(0) == sum(l)*2
-
- graph = self.codetest(f)
- ops = self.all_operations(graph)
- assert ops == {'inplace_add': 10, 'mul': 1}
-
def test_unroller(self):
l = unrolling_iterable(range(10))
def f(tot):
diff --git a/rpython/rlib/unroll.py b/rpython/rlib/unroll.py
--- a/rpython/rlib/unroll.py
+++ b/rpython/rlib/unroll.py
@@ -6,31 +6,14 @@
class SpecTag(object):
__slots__ = ()
-
+
def __repr__(self):
return '%s(0x%x)' % (self.__class__.__name__, uid(self))
+
def _freeze_(self):
return True
-class unrolling_int(int, SpecTag):
-
- def __add__(self, other):
- return unrolling_int(int.__add__(self, other))
-
- __radd__ = __add__
-
- def __sub__(self, other):
- return unrolling_int(int.__sub__(self, other))
-
- def __rsub__(self, other):
- return unrolling_int(int.__rsub__(self, other))
-
-
-unrolling_zero = unrolling_int(0)
-
-# ____________________________________________________________
-
# 'for' iteration over iterables wrapped in an instance
# of unrolling_iterable will be unrolled by the flow space,
# like in:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit