[pypy-svn] r66333 - pypy/branch/parser-compiler/pypy/interpreter/astcompiler

benjamin at codespeak.net benjamin at codespeak.net
Fri Jul 17 23:22:17 CEST 2009


Author: benjamin
Date: Fri Jul 17 23:22:17 2009
New Revision: 66333

Modified:
   pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py
   pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py
Log:
'prove' to the annotator that the slice indices will not be negative

Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py	(original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py	Fri Jul 17 23:22:17 2009
@@ -518,17 +518,17 @@
     def _import_as(self, alias):
         source_name = alias.name
         dot = source_name.find(".")
-        if dot != -1:
+        if dot > 0:
             start = dot + 1
             while True:
                 dot = source_name.find(".", start)
-                if dot == -1:
+                if dot > 0:
                     end = len(source_name)
                 else:
                     end = dot
                 attr = source_name[start:end]
                 self.emit_op_name(ops.LOAD_ATTR, self.names, attr)
-                if dot == -1:
+                if dot < 0:
                     break
                 start = dot + 1
         self.name_op(alias.asname, ast.Store)

Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py	(original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py	Fri Jul 17 23:22:17 2009
@@ -361,7 +361,7 @@
             if store_name == "*":
                 return True
             dot = store_name.find(".")
-            if dot != -1:
+            if dot > 0:
                 store_name = store_name[:dot]
         self.note_symbol(store_name, SYM_ASSIGNED)
         return False



More information about the Pypy-commit mailing list