[pypy-svn] r9758 - in pypy/dist/pypy: annotation objspace/flow translator/test

pedronis at codespeak.net pedronis at codespeak.net
Mon Mar 14 14:03:36 CET 2005


Author: pedronis
Date: Mon Mar 14 14:03:36 2005
New Revision: 9758

Modified:
   pypy/dist/pypy/annotation/unaryop.py
   pypy/dist/pypy/objspace/flow/specialcase.py
   pypy/dist/pypy/translator/test/test_annrpython.py
Log:
- annotation for list.extend

- comment about never used code



Modified: pypy/dist/pypy/annotation/unaryop.py
==============================================================================
--- pypy/dist/pypy/annotation/unaryop.py	(original)
+++ pypy/dist/pypy/annotation/unaryop.py	Mon Mar 14 14:03:36 2005
@@ -118,6 +118,9 @@
     def method_append(lst, s_value):
         pair(lst, SomeInteger()).setitem(s_value)
 
+    def method_extend(lst, s_iterable):
+        pair(lst, SomeInteger()).setitem(s_iterable.iter())
+
     def method_reverse(lst):
         pass
 

Modified: pypy/dist/pypy/objspace/flow/specialcase.py
==============================================================================
--- pypy/dist/pypy/objspace/flow/specialcase.py	(original)
+++ pypy/dist/pypy/objspace/flow/specialcase.py	Mon Mar 14 14:03:36 2005
@@ -55,6 +55,10 @@
     # Normally, Instance should have been created by the previous operation
     # which should be a simple_call(<Class>, ...).
     # Fetch the <Class> out of there.  (This doesn't work while replaying)
+    # XXX this case is likely not triggered anymore, because the instance creation op
+    # is walled off in a different block by the surrounding it with exception
+    # handling logic that is always put in place for calls.
+    # We may want to make this more clever!
     operations = space.executioncontext.recorder.crnt_block.operations
     if operations:
         spaceop = operations[-1]

Modified: pypy/dist/pypy/translator/test/test_annrpython.py
==============================================================================
--- pypy/dist/pypy/translator/test/test_annrpython.py	(original)
+++ pypy/dist/pypy/translator/test/test_annrpython.py	Mon Mar 14 14:03:36 2005
@@ -369,7 +369,8 @@
         # the annotator (it doesn't check that they operate property, though)
         for example, methname, s_example in [
             ('', 'join',    annmodel.SomeString()),
-            ([], 'append',  annmodel.SomeList({})),
+            ([], 'append',  annmodel.SomeList({})), 
+            ([], 'extend',  annmodel.SomeList({})),           
             ([], 'reverse', annmodel.SomeList({})),
             ([], 'insert',  annmodel.SomeList({})),
             ([], 'pop',     annmodel.SomeList({})),



More information about the Pypy-commit mailing list