[pypy-svn] r12921 - pypy/dist/pypy/rpython

pedronis at codespeak.net pedronis at codespeak.net
Tue May 31 15:02:07 CEST 2005


Author: pedronis
Date: Tue May 31 15:02:07 2005
New Revision: 12921

Modified:
   pypy/dist/pypy/rpython/lltype.py
Log:
more sensible repr for pointers



Modified: pypy/dist/pypy/rpython/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltype.py	(original)
+++ pypy/dist/pypy/rpython/lltype.py	Tue May 31 15:02:07 2005
@@ -215,8 +215,11 @@
             result.append(flag)
         return ', '.join(result)
 
+    def _str_flavor(self):
+        return 'ptr(%s)' % self._str_flags()
+
     def __str__(self):
-        return 'ptr(%s) to %s' % (self._str_flags(), self.TO)
+        return '%s to %s' % (self._str_flavor(), self.TO)
 
     def _defl(self, parent=None, parentindex=None):
         return _ptr(self, None)
@@ -428,7 +431,7 @@
         return '<%s>' % (self,)
 
     def __str__(self):
-        return '%s to %s' % (self._TYPE.__class__.__name__.lower(), self._obj)
+        return '%s to %s' % (self._TYPE._str_flavor(), self._obj)
 
     def __call__(self, *args):
         if isinstance(self._T, FuncType):



More information about the Pypy-commit mailing list