[pypy-svn] r79470 - pypy/branch/fast-forward/pypy/objspace/std

afa at codespeak.net afa at codespeak.net
Wed Nov 24 16:24:39 CET 2010


Author: afa
Date: Wed Nov 24 16:24:37 2010
New Revision: 79470

Modified:
   pypy/branch/fast-forward/pypy/objspace/std/sliceobject.py
Log:
Add a repr() to W_SliceObject; for debugging


Modified: pypy/branch/fast-forward/pypy/objspace/std/sliceobject.py
==============================================================================
--- pypy/branch/fast-forward/pypy/objspace/std/sliceobject.py	(original)
+++ pypy/branch/fast-forward/pypy/objspace/std/sliceobject.py	Wed Nov 24 16:24:37 2010
@@ -6,7 +6,6 @@
 from pypy.objspace.std.register_all import register_all
 from pypy.objspace.std.slicetype import _Eval_SliceIndex
 
-
 class W_SliceObject(W_Object):
     from pypy.objspace.std.slicetype import slice_typedef as typedef
     _immutable_ = True
@@ -80,6 +79,10 @@
             slicelength = (stop - start - 1) / step + 1
         return start, stop, step, slicelength
 
+    def __repr__(self):
+        return "<W_SliceObject(%r, %r, %r)>" % (
+            self.w_start, self.w_stop, self.w_step)
+
 registerimplementation(W_SliceObject)
 
 



More information about the Pypy-commit mailing list