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

pedronis at codespeak.net pedronis at codespeak.net
Mon Jun 20 23:56:27 CEST 2005


Author: pedronis
Date: Mon Jun 20 23:56:25 2005
New Revision: 13638

Modified:
   pypy/dist/pypy/rpython/rint.py
Log:
oops, in the end, we don't want int->char as a generic conversion



Modified: pypy/dist/pypy/rpython/rint.py
==============================================================================
--- pypy/dist/pypy/rpython/rint.py	(original)
+++ pypy/dist/pypy/rpython/rint.py	Mon Jun 20 23:56:25 2005
@@ -196,8 +196,8 @@
         return vlist[0]
 
     def rtype_chr(_, hop):
-        vlist =  hop.inputargs(Char)
-        return vlist[0]
+        vlist =  hop.inputargs(Signed)
+        return hop.genop('cast_int_to_char', vlist, resulttype=Char)
 
     def rtype_is_true(self, hop):
         if self.lowleveltype == Unsigned:
@@ -286,9 +286,3 @@
             return llops.gencapicall('PyInt_FromLong', [v],
                                      resulttype=pyobj_repr)
         return NotImplemented
-
-class __extend__(pairtype(IntegerRepr, CharRepr)):
-        def convert_from_to((r_from, r_to), v, llops):
-            if r_from.lowleveltype == Signed:
-                return llops.genop('cast_int_to_char', [v], resulttype=Char)
-            return NotImplemented



More information about the Pypy-commit mailing list