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
Boxiang Sun
cython
Commits
d1e91664
Commit
d1e91664
authored
Nov 04, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent auto_cpdef from breaking module-level lambdas
parent
ccfad0a2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+4
-0
tests/run/auto_cpdef.py
tests/run/auto_cpdef.py
+8
-0
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
d1e91664
...
...
@@ -2031,6 +2031,10 @@ class AlignFunctionDefinitions(CythonTransform):
# self.visitchildren(node)
return
node
def
visit_ExprNode
(
self
,
node
):
# ignore lambdas and everything else that appears in expressions
return
node
class
RemoveUnreachableCode
(
CythonTransform
):
def
visit_Node
(
self
,
node
):
...
...
tests/run/auto_cpdef.py
View file @
d1e91664
...
...
@@ -37,3 +37,11 @@ def starstararg_func(**kwargs):
1
"""
return
kwargs
[
'a'
]
l
=
lambda
x
:
1
def
test_lambda
():
"""
>>> l(1)
1
"""
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