Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
f951fbcc
Commit
f951fbcc
authored
Dec 15, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
7d068106
8cbe375b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+2
-2
Demos/benchmarks/setup.py
Demos/benchmarks/setup.py
+6
-1
tests/run/closure_inlining.pyx
tests/run/closure_inlining.pyx
+10
-0
No files found.
Cython/Compiler/Optimize.py
View file @
f951fbcc
...
...
@@ -1661,8 +1661,8 @@ class InlineDefNodeCalls(Visitor.CythonTransform):
function_name
=
node
.
function
if
not
function_name
.
is_name
:
return
node
if
(
function_name
.
cf_state
is
None
or
not
function_name
.
cf_state
.
is_single
):
if
(
function_name
.
cf_state
is
None
# global scope
or
not
function_name
.
cf_state
.
is_single
):
return
node
function
=
function_name
.
cf_state
.
one
().
rhs
if
not
isinstance
(
function
,
ExprNodes
.
PyCFunctionNode
):
...
...
Demos/benchmarks/setup.py
View file @
f951fbcc
from
distutils.core
import
setup
from
Cython.Build
import
cythonize
directives
=
{
'optimize.inline_defnode_calls'
:
True
}
setup
(
name
=
'benchmarks'
,
ext_modules
=
cythonize
(
"*.py"
,
language_level
=
3
,
annotate
=
True
),
ext_modules
=
cythonize
(
"*.py"
,
language_level
=
3
,
annotate
=
True
,
compiler_directives
=
directives
),
)
tests/run/closure_inlining.pyx
View file @
f951fbcc
...
...
@@ -75,3 +75,13 @@ def test_starred(a):
def
inner
(
a
,
*
args
,
**
kwargs
):
return
a
,
args
,
kwargs
return
inner
(
a
)
def
test_global_calls_still_work
():
"""
>>> global_call_result
123
"""
return
123
global_call_result
=
test_global_calls_still_work
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment