[pypy-svn] r48457 - pypy/branch/pypy-rpython-unicode/rpython/ootypesystem

fijal at codespeak.net fijal at codespeak.net
Thu Nov 8 23:24:19 CET 2007


Author: fijal
Date: Thu Nov  8 23:24:18 2007
New Revision: 48457

Modified:
   pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ooregistry.py
   pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ootype.py
Log:
Some more tests passing


Modified: pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ooregistry.py
==============================================================================
--- pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ooregistry.py	(original)
+++ pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ooregistry.py	Thu Nov  8 23:24:18 2007
@@ -85,11 +85,13 @@
 
     def compute_result_annotation(self, str_s):
         assert isinstance(str_s, annmodel.SomeOOInstance)\
-               and str_s.ootype is ootype.String
+               and (str_s.ootype is ootype.String or
+                    str_s.ootype is ootype.Unicode)
         return annmodel.SomeInteger()
 
     def specialize_call(self, hop):
         assert isinstance(hop.args_s[0], annmodel.SomeOOInstance)\
-               and hop.args_s[0].ootype is ootype.String
+               and (hop.args_s[0].ootype is ootype.String or
+                    hop.args_s[0].ootype is ootype.Unicode)
         vlist = hop.inputargs(hop.args_r[0])
         return hop.genop('oohash', vlist, resulttype=ootype.Signed)

Modified: pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ootype.py	(original)
+++ pypy/branch/pypy-rpython-unicode/rpython/ootypesystem/ootype.py	Thu Nov  8 23:24:18 2007
@@ -1163,7 +1163,7 @@
 
     def ll_split_chr(self, ch):
         # NOT_RPYTHON
-        res = _list(List(String))
+        res = _list(List(self._TYPE))
         res._list = [self.make_string(s) for s in self._str.split(ch)]
         return res
 
@@ -1541,7 +1541,8 @@
     return inst._identityhash()
 
 def oohash(inst):
-    assert typeOf(inst) is String # for now only strings are supported
+    assert typeOf(inst) is String or typeOf(inst) is Unicode
+    # for now only strings and unicode are supported
     return hash(inst._str)
 
 def oostring(obj, base):



More information about the Pypy-commit mailing list