[pypy-svn] r13701 - in pypy/dist/pypy/rpython: . test
tismer at codespeak.net
tismer at codespeak.net
Thu Jun 23 14:03:02 CEST 2005
Author: tismer
Date: Thu Jun 23 14:03:01 2005
New Revision: 13701
Modified:
pypy/dist/pypy/rpython/rlist.py
pypy/dist/pypy/rpython/test/test_rlist.py
Log:
just a bit of sanitization
Modified: pypy/dist/pypy/rpython/rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/rlist.py (original)
+++ pypy/dist/pypy/rpython/rlist.py Thu Jun 23 14:03:01 2005
@@ -89,11 +89,11 @@
v_lst, = hop.inputargs(self)
hop.gendirectcall(ll_reverse,v_lst)
- def rtype_method_pop(self,hop):
- v_list,v_index = hop.inputargs(self,Signed)
+ def rtype_method_pop(self, hop):
+ v_list, v_index = hop.inputargs(self, Signed)
#v_index = hop.inputconst(Signed,-1)
- assert hasattr(v_index,'concretetype')
- return hop.gendirectcall(ll_pop,v_list,v_index)
+ assert hasattr(v_index, 'concretetype')
+ return hop.gendirectcall(ll_pop, v_list, v_index)
def make_iterator_repr(self):
return ListIteratorRepr(self)
@@ -181,31 +181,31 @@
length = len(l.items)
newitems = malloc(typeOf(l).TO.items.TO, length+1)
i = 0
- while i<length:
+ while i < length:
newitems[i] = l.items[i]
i += 1
newitems[length] = newitem
l.items = newitems
-def ll_pop(l,index):
- res = ll_getitem(l,index)
- ll_delitem(l,index)
+def ll_pop(l, index):
+ res = ll_getitem(l, index)
+ ll_delitem(l, index)
return res
def ll_reverse(l):
length = len(l.items)
- i=0
- while i<length/2:
+ i = 0
+ while i < length // 2:
tmp = l.items[i]
l.items[i] = l.items[length-1-i]
l.items[length-1-i] = tmp
- i +=1
-
+ i += 1
+
def ll_getitem_nonneg(l, i):
return l.items[i]
def ll_getitem(l, i):
- if i<0:
+ if i < 0:
i += len(l.items)
return l.items[i]
@@ -213,7 +213,7 @@
l.items[i] = newitem
def ll_setitem(l, i, newitem):
- if i<0:
+ if i < 0:
i += len(l.items)
l.items[i] = newitem
Modified: pypy/dist/pypy/rpython/test/test_rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rlist.py (original)
+++ pypy/dist/pypy/rpython/test/test_rlist.py Thu Jun 23 14:03:01 2005
@@ -95,7 +95,7 @@
def test_simple():
def dummyfn():
- l = [10,20,30]
+ l = [10, 20, 30]
return l[2]
rtype(dummyfn)
@@ -109,14 +109,14 @@
def test_len():
def dummyfn():
- l = [5,10]
+ l = [5, 10]
return len(l)
rtype(dummyfn)
def test_iterate():
def dummyfn():
total = 0
- for x in [1,3,5,7,9]:
+ for x in [1, 3, 5, 7, 9]:
total += x
return total
rtype(dummyfn)
@@ -165,7 +165,7 @@
assert res == 'z'
def test_bound_list_method():
- klist = [1,2,3]
+ klist = [1, 2, 3]
# for testing constant methods without actually mutating the constant
def dummyfn(n):
klist.extend([])
More information about the Pypy-commit
mailing list