[pypy-commit] pypy list-strategies: (l.diekmann, cfbolz): this needs an equivalent look_inside_iff

l.diekmann noreply at buildbot.pypy.org
Fri Sep 30 15:57:30 CEST 2011


Author: Lukas Diekmann <lukas.diekmann at uni-duesseldorf.de>
Branch: list-strategies
Changeset: r47716:d09c1d4594e4
Date: 2011-09-30 15:57 +0200
http://bitbucket.org/pypy/pypy/changeset/d09c1d4594e4/

Log:	(l.diekmann, cfbolz): this needs an equivalent look_inside_iff

diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -580,6 +580,8 @@
     def list_is_correct_type(self, w_list):
         raise NotImplementedError("abstract base class")
 
+    @jit.look_inside_iff(lambda space, w_list, list_w:
+        jit.isconstant(len(list_w)) and len(list_w) < 5)
     def init_from_list_w(self, w_list, list_w):
         l = [self.unwrap(w_item) for w_item in list_w]
         w_list.lstorage = self.erase(l)


More information about the pypy-commit mailing list