Commit f951fbcc authored by Stefan Behnel's avatar Stefan Behnel

merge

parents 7d068106 8cbe375b
...@@ -1661,8 +1661,8 @@ class InlineDefNodeCalls(Visitor.CythonTransform): ...@@ -1661,8 +1661,8 @@ class InlineDefNodeCalls(Visitor.CythonTransform):
function_name = node.function function_name = node.function
if not function_name.is_name: if not function_name.is_name:
return node return node
if (function_name.cf_state is None or if (function_name.cf_state is None # global scope
not function_name.cf_state.is_single): or not function_name.cf_state.is_single):
return node return node
function = function_name.cf_state.one().rhs function = function_name.cf_state.one().rhs
if not isinstance(function, ExprNodes.PyCFunctionNode): if not isinstance(function, ExprNodes.PyCFunctionNode):
......
from distutils.core import setup from distutils.core import setup
from Cython.Build import cythonize from Cython.Build import cythonize
directives = {
'optimize.inline_defnode_calls': True
}
setup( setup(
name = 'benchmarks', name = 'benchmarks',
ext_modules = cythonize("*.py", language_level=3, annotate=True), ext_modules = cythonize("*.py", language_level=3, annotate=True,
compiler_directives=directives),
) )
...@@ -75,3 +75,13 @@ def test_starred(a): ...@@ -75,3 +75,13 @@ def test_starred(a):
def inner(a, *args, **kwargs): def inner(a, *args, **kwargs):
return a, args, kwargs return a, args, kwargs
return inner(a) return inner(a)
def test_global_calls_still_work():
"""
>>> global_call_result
123
"""
return 123
global_call_result = test_global_calls_still_work()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment