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
Gwenaël Samain
cython
Commits
50570112
Commit
50570112
authored
Apr 01, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merged in Vitek's fix for ticket 668
parents
70a90e81
eaad966e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+14
-0
tests/run/delete.pyx
tests/run/delete.pyx
+9
-0
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
50570112
...
@@ -299,6 +299,20 @@ class PostParse(ScopeTrackingTransform):
...
@@ -299,6 +299,20 @@ class PostParse(ScopeTrackingTransform):
return
assign_node
return
assign_node
def
_flatten_sequence
(
self
,
seq
,
result
):
for
arg
in
seq
.
args
:
if
arg
.
is_sequence_constructor
:
self
.
_flatten_sequence
(
arg
,
result
)
else
:
result
.
append
(
arg
)
return
result
def
visit_DelStatNode
(
self
,
node
):
self
.
visitchildren
(
node
)
node
.
args
=
self
.
_flatten_sequence
(
node
,
[])
return
node
def
eliminate_rhs_duplicates
(
expr_list_list
,
ref_node_sequence
):
def
eliminate_rhs_duplicates
(
expr_list_list
,
ref_node_sequence
):
"""Replace rhs items by LetRefNodes if they appear more than once.
"""Replace rhs items by LetRefNodes if they appear more than once.
Creates a sequence of LetRefNodes that set up the required temps
Creates a sequence of LetRefNodes that set up the required temps
...
...
tests/run/delete.pyx
View file @
50570112
...
@@ -87,3 +87,12 @@ def del_local(a):
...
@@ -87,3 +87,12 @@ def del_local(a):
"""
"""
del
a
del
a
assert
a
is
None
# Until we have unbound locals...
assert
a
is
None
# Until we have unbound locals...
def
del_seq
(
a
,
b
,
c
):
"""
>>> del_seq(1, 2, 3)
"""
del
a
,
(
b
,
c
)
assert
a
is
None
# Until we have unbound locals...
assert
b
is
None
# Until we have unbound locals...
assert
c
is
None
# Until we have unbound locals...
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