Author: Richard Plangger <planri...@gmail.com>
Branch: gcstress-hypothesis
Changeset: r82982:c9580f93ed9e
Date: 2016-03-11 17:21 +0100
http://bitbucket.org/pypy/pypy/changeset/c9580f93ed9e/

Log:    directly invoke filter instead of the filter method of a strategy

diff --git a/rpython/jit/backend/llsupport/tl/test/code_strategies.py 
b/rpython/jit/backend/llsupport/tl/test/code_strategies.py
--- a/rpython/jit/backend/llsupport/tl/test/code_strategies.py
+++ b/rpython/jit/backend/llsupport/tl/test/code_strategies.py
@@ -100,7 +100,8 @@
 @st.defines_strategy
 def bytecode_class(stack):
     # get a byte code class, only allow what is valid for the run_stack
-    return st.sampled_from(code.BC_CLASSES).filter(lambda clazz: 
clazz.filter_bytecode(stack))
+    clazzes = filter(lambda clazz: clazz.filter_bytecode(stack), 
code.BC_CLASSES)
+    return st.sampled_from(clazzes)
 
 
 @composite
@@ -109,7 +110,8 @@
     run_stack = draw(st.shared(st.just(stack.Stack(0)), 'stack2'))
 
     # get a byte code class, only allow what is valid for the run_stack
-    clazz = draw(st.sampled_from(code.BC_CLASSES).filter(lambda clazz: 
clazz.filter_bytecode(run_stack)))
+    clazzes = filter(lambda clazz: clazz.filter_bytecode(run_stack), 
code.BC_CLASSES)
+    clazz = draw(st.sampled_from(clazzes))
 
     # create an instance of the chosen class
     pt = getattr(clazz.__init__, '_param_types', [])
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to