[pypy-svn] r10713 - pypy/dist/pypy/annotation
arigo at codespeak.net
arigo at codespeak.net
Fri Apr 15 22:05:22 CEST 2005
Author: arigo
Date: Fri Apr 15 22:05:22 2005
New Revision: 10713
Modified:
pypy/dist/pypy/annotation/dictdef.py
pypy/dist/pypy/annotation/listdef.py
Log:
ListDef and DictDef need a __repr__ to show meaningful information in the
Pygame viewer.
Modified: pypy/dist/pypy/annotation/dictdef.py
==============================================================================
--- pypy/dist/pypy/annotation/dictdef.py (original)
+++ pypy/dist/pypy/annotation/dictdef.py Fri Apr 15 22:05:22 2005
@@ -66,5 +66,8 @@
def generalize_value(self, s_value):
self.dictvalue.generalize(s_value)
+ def __repr__(self):
+ return '<%r: %r>' % (self.dictkey.s_value, self.dictvalue.s_value)
+
MOST_GENERAL_DICTDEF = DictDef(None, SomeObject(), SomeObject())
Modified: pypy/dist/pypy/annotation/listdef.py
==============================================================================
--- pypy/dist/pypy/annotation/listdef.py (original)
+++ pypy/dist/pypy/annotation/listdef.py Fri Apr 15 22:05:22 2005
@@ -63,5 +63,8 @@
def generalize(self, s_value):
self.listitem.generalize(s_value)
+ def __repr__(self):
+ return '<%r>' % (self.listitem.s_value,)
+
MOST_GENERAL_LISTDEF = ListDef(None, SomeObject())
More information about the Pypy-commit
mailing list