Author: Manuel Jacob
Branch: remove-tuple-smm
Changeset: r64457:352a63d3b2ae
Date: 2013-05-22 17:52 +0200
http://bitbucket.org/pypy/pypy/changeset/352a63d3b2ae/

Log:    style fixes

diff --git a/pypy/objspace/std/specialisedtupleobject.py 
b/pypy/objspace/std/specialisedtupleobject.py
--- a/pypy/objspace/std/specialisedtupleobject.py
+++ b/pypy/objspace/std/specialisedtupleobject.py
@@ -86,8 +86,7 @@
                         myval = space.wrap(myval)
                     if not space.eq_w(myval, otherval):
                         return space.w_False
-                else:
-                    return space.w_True
+                return space.w_True
 
             for i in iter_n:
                 myval = getattr(self, 'value%s' % i)
@@ -98,8 +97,7 @@
                 else:
                     if myval != otherval:
                         return space.w_False
-            else:
-                return space.w_True
+            return space.w_True
 
         descr_ne = negate(descr_eq)
 
diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -11,7 +11,6 @@
 from rpython.rlib import jit
 from rpython.rlib.debug import make_sure_not_resized
 from rpython.rlib.rarithmetic import intmask
-from rpython.tool.sourcetools import func_with_new_name
 
 
 UNROLL_CUTOFF = 10
@@ -29,13 +28,13 @@
 class W_AbstractTupleObject(W_Root):
     __slots__ = ()
 
-    def __repr__(w_self):
+    def __repr__(self):
         """representation for debugging purposes"""
-        reprlist = [repr(w_item) for w_item in w_self.tolist()]
-        return "%s(%s)" % (w_self.__class__.__name__, ', '.join(reprlist))
+        reprlist = [repr(w_item) for w_item in self.tolist()]
+        return "%s(%s)" % (self.__class__.__name__, ', '.join(reprlist))
 
-    def unwrap(w_tuple, space):
-        items = [space.unwrap(w_item) for w_item in w_tuple.tolist()]
+    def unwrap(self, space):
+        items = [space.unwrap(w_item) for w_item in self.tolist()]
         return tuple(items)
 
     def tolist(self):
@@ -112,7 +111,8 @@
             # No more items to compare -- compare sizes
             return space.newbool(op(len(items1), len(items2)))
 
-        return func_with_new_name(compare_tuples, name + '__Tuple_Tuple')
+        compare_tuples.__name__ = 'descr_' + name
+        return compare_tuples
 
     descr_lt = _make_tuple_comparison('lt')
     descr_le = _make_tuple_comparison('le')
@@ -233,9 +233,9 @@
 class W_TupleObject(W_AbstractTupleObject):
     _immutable_fields_ = ['wrappeditems[*]']
 
-    def __init__(w_self, wrappeditems):
+    def __init__(self, wrappeditems):
         make_sure_not_resized(wrappeditems)
-        w_self.wrappeditems = wrappeditems   # a list of wrapped values
+        self.wrappeditems = wrappeditems   # a list of wrapped values
 
     def tolist(self):
         return self.wrappeditems
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to