Author: Manuel Jacob
Branch: refactor-str-types
Changeset: r65691:ecbc6045476e
Date: 2013-07-26 16:57 +0200
http://bitbucket.org/pypy/pypy/changeset/ecbc6045476e/

Log:    Add more specializations.

diff --git a/pypy/objspace/std/stringmethods.py 
b/pypy/objspace/std/stringmethods.py
--- a/pypy/objspace/std/stringmethods.py
+++ b/pypy/objspace/std/stringmethods.py
@@ -95,7 +95,7 @@
     def descr_len(self, space):
         return space.wrap(self._len())
 
-    @specialize.argtype(0)
+    #@specialize.argtype(0)
     #def descr_iter(self, space):
     #    pass
 
@@ -645,6 +645,7 @@
             return space.w_False
         return space.newbool(self._startswith(space, value, w_prefix, start, 
end))
 
+    @specialize.argtype(0)
     def _startswith(self, space, value, w_prefix, start, end):
         return startswith(value, self._op_val(space, w_prefix), start, end)
 
@@ -660,6 +661,7 @@
             return space.w_False
         return space.newbool(self._endswith(space, value, w_suffix, start, 
end))
 
+    @specialize.argtype(0)
     def _endswith(self, space, value, w_prefix, start, end):
         return endswith(value, self._op_val(space, w_prefix), start, end)
 
diff --git a/pypy/objspace/std/unicodeobject.py 
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -313,6 +313,7 @@
         raise operationerrfmt(space.w_TypeError,
             "decoder did not return an unicode object (type '%s')",
             space.type(w_retval).getname(space))
+    assert isinstance(w_retval, W_UnicodeObject)
     return w_retval
 
 def unicode_from_object(space, w_obj):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to