2010/12/3 Vitja Makarov <[email protected]>: > 2010/12/3 Stefan Behnel <[email protected]>: >> Stefan Behnel, 03.12.2010 15:14: >>> Vitja Makarov, 03.12.2010 14:27: >>>> Stefan Behnel (from trac): >>>>> Why not have a method generate_lambda_definitions() somewhere up the AST >>>>> hierarchy? Maybe in BlockNode? You could just pass in the relevant scope >>>>> explicitly. >>>> >>>> I've updated patch. Now all lambdas are defined in >>>> BlockNode.generate_lambda_definitions() >>> >>> Yes, that's much cleaner. Time to ask Hudson. >>> >>> http://hg.cython.org/cython-devel/rev/067bda3960e4 >> >> Hmm, looks like neither of us ran the test suite after the change: >> >> https://sage.math.washington.edu:8091/hudson/job/cython-devel-tests-py2-trunk-c/614/testReport/ >> >> Stefan > > Sorry I ran it for previous version :( > > -- > vitja. >
Here is small patch. -- vitja.
exporting patch: # HG changeset patch # User Vitja Makarov <[email protected]> # Date 1291387058 -10800 # Node ID 46a7dfd40c08b983f6255c44a9d305135beb9fd3 # Parent 067bda3960e4e10e32c33f0b71b362451d22cde8 Fix CClassDefNode.generate_function_definitions(), scope isn't allways defined diff -r 067bda3960e4 -r 46a7dfd40c08 Cython/Compiler/Nodes.py --- a/Cython/Compiler/Nodes.py Fri Dec 03 16:24:03 2010 +0300 +++ b/Cython/Compiler/Nodes.py Fri Dec 03 17:37:38 2010 +0300 @@ -3244,7 +3244,8 @@ self.body.analyse_expressions(scope) def generate_function_definitions(self, env, code): - self.generate_lambda_definitions(self.scope, code) + if self.scope: + self.generate_lambda_definitions(self.scope, code) if self.body: self.body.generate_function_definitions( self.entry.type.scope, code)
_______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
