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
eb1e7173
Commit
eb1e7173
authored
Apr 12, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cascaded assignments of None to extension type variables
parent
3c118b8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+6
-5
tests/run/unpack.pyx
tests/run/unpack.pyx
+24
-0
No files found.
Cython/Compiler/Nodes.py
View file @
eb1e7173
...
@@ -4573,11 +4573,12 @@ class CascadedAssignmentNode(AssignmentNode):
...
@@ -4573,11 +4573,12 @@ class CascadedAssignmentNode(AssignmentNode):
from
ExprNodes
import
CloneNode
,
ProxyNode
from
ExprNodes
import
CloneNode
,
ProxyNode
self
.
rhs
=
self
.
rhs
.
analyse_types
(
env
)
self
.
rhs
=
self
.
rhs
.
analyse_types
(
env
)
if
use_temp
or
self
.
rhs
.
is_attribute
:
# (cdef) attribute access is not safe as it traverses pointers
# (cdef) attribute access is not safe as it traverses pointers
if
self
.
rhs
.
is_attribute
or
not
self
.
rhs
.
is_simple
():
self
.
rhs
=
self
.
rhs
.
coerce_to_temp
(
env
)
if
use_temp
:
else
:
self
.
rhs
=
self
.
rhs
.
coerce_to_temp
(
env
)
self
.
rhs
=
self
.
rhs
.
coerce_to_simple
(
env
)
else
:
self
.
rhs
=
self
.
rhs
.
coerce_to_simple
(
env
)
self
.
rhs
=
ProxyNode
(
self
.
rhs
)
self
.
rhs
=
ProxyNode
(
self
.
rhs
)
self
.
coerced_rhs_list
=
[]
self
.
coerced_rhs_list
=
[]
...
...
tests/run/unpack.pyx
View file @
eb1e7173
...
@@ -363,3 +363,27 @@ def unpack_many_int(it):
...
@@ -363,3 +363,27 @@ def unpack_many_int(it):
cdef
Py_ssize_t
h
cdef
Py_ssize_t
h
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
,
k
,
l
=
it
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
,
k
,
l
=
it
return
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
,
k
,
l
return
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
,
k
,
l
def
unpack_literal_none_to_builtin_type
():
"""
>>> unpack_literal_none_to_builtin_type()
(None, None, None, None)
"""
cdef
list
a
,
b
,
c
,
d
a
,
b
=
c
,
d
=
None
,
None
return
a
,
b
,
c
,
d
cdef
class
ExtType
:
pass
def
unpack_literal_none_to_exttype
():
"""
>>> unpack_literal_none_to_exttype()
(None, None, None, None)
"""
cdef
ExtType
a
,
b
,
c
,
d
a
,
b
=
c
,
d
=
None
,
None
return
a
,
b
,
c
,
d
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