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

arigo at codespeak.net arigo at codespeak.net
Fri Jul 29 03:44:57 CEST 2005


Author: arigo
Date: Fri Jul 29 03:44:55 2005
New Revision: 15319

Modified:
   pypy/dist/pypy/rpython/rslice.py
Log:
Fix for a bug that hides an unknown number of "slice indices must be proved
non-negative".

Picking the key for the rtyper repr must be done veeeery carefully...

(pedronis, arigo)


Modified: pypy/dist/pypy/rpython/rslice.py
==============================================================================
--- pypy/dist/pypy/rpython/rslice.py	(original)
+++ pypy/dist/pypy/rpython/rslice.py	Fri Jul 29 03:44:55 2005
@@ -40,14 +40,9 @@
             return startstop_slice_repr
         
     def rtyper_makekey(self):
-        if (self.start.is_constant() and self.start.const in (None, 0) and
-            self.stop.is_constant() and self.stop.const == -1):
-            kind = "minusone"    # [:-1]
-        elif self.stop.is_constant() and self.stop.const is None:
-            kind = "startonly"
-        else:
-            kind = "startstop"
-        return self.__class__, kind
+        # use the repr itself as the key (it can only be one of the three
+        # prebuilt reprs below).
+        return self.__class__, self.rtyper_makerepr(None)
 
 
 class SliceRepr(Repr):



More information about the Pypy-commit mailing list