[pypy-svn] r26443 - pypy/dist/pypy/rpython/ootypesystem

antocuni at codespeak.net antocuni at codespeak.net
Thu Apr 27 14:34:44 CEST 2006


Author: antocuni
Date: Thu Apr 27 14:34:39 2006
New Revision: 26443

Modified:
   pypy/dist/pypy/rpython/ootypesystem/ootype.py
Log:
Added _lookup_field to Record, so that its interface is more similar
to the Instance's one.



Modified: pypy/dist/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/ootype.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/ootype.py	Thu Apr 27 14:34:39 2006
@@ -225,6 +225,12 @@
     def _lookup(self, meth_name):
         return self, None
 
+    def _lookup_field(self, name):
+        try:
+            return self, self._field_type(name)
+        except TypeError:
+            return self, None
+
     def __str__(self):
         item_str = ["%s: %s" % (str(name), str(ITEMTYPE))
                     for name, (ITEMTYPE, _) in self._fields.items()]



More information about the Pypy-commit mailing list