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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
155664e8
Commit
155664e8
authored
Aug 29, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix genexpr inside comprehension, ticket #715
parent
f8f64ff3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+4
-0
tests/run/genexpr_T715.pyx
tests/run/genexpr_T715.pyx
+13
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
155664e8
...
...
@@ -4554,7 +4554,7 @@ class ScopedExprNode(ExprNode):
class
ComprehensionNode
(
ScopedExprNode
):
subexprs
=
[
"target"
]
child_attrs
=
[
"loop"
,
"append"
]
child_attrs
=
[
"loop"
]
def
infer_type
(
self
,
env
):
return
self
.
target
.
infer_type
(
env
)
...
...
Cython/Compiler/Symtab.py
View file @
155664e8
...
...
@@ -1512,6 +1512,10 @@ class GeneratorExpressionScope(Scope):
self
.
entries
[
name
]
=
entry
return
entry
def
declare_pyfunction
(
self
,
name
,
pos
,
allow_redefine
=
False
):
return
self
.
outer_scope
.
declare_pyfunction
(
name
,
pos
,
allow_redefine
)
def
declare_lambda_function
(
self
,
func_cname
,
pos
):
return
self
.
outer_scope
.
declare_lambda_function
(
func_cname
,
pos
)
...
...
tests/run/genexpr_T715.pyx
0 → 100644
View file @
155664e8
# mode: run
# ticket: 715
# tags: genexpr, comprehension
def
t715
(
*
items
):
"""
# Blocked by T724
# >>> [list(i) for i in t715([1, 2, 3], [4, 5, 6])]
# [[1, 2, 3], [4, 5, 6]]
>>> [list(i) for i in t715([1, 2, 3])]
[[1, 2, 3]]
"""
return
[(
j
for
j
in
i
)
for
i
in
items
]
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