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
Xavier Thompson
cython
Commits
bbc4c9e2
Commit
bbc4c9e2
authored
Oct 03, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix in-place operations again: type inference may not work in advance
parent
47a94155
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-2
Cython/Compiler/FlowControl.py
Cython/Compiler/FlowControl.py
+1
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
bbc4c9e2
...
@@ -704,7 +704,7 @@ class ExprNode(Node):
...
@@ -704,7 +704,7 @@ class ExprNode(Node):
return
self
.
result_in_temp
()
return
self
.
result_in_temp
()
def
may_be_none
(
self
):
def
may_be_none
(
self
):
if
not
self
.
type
.
is_pyobject
:
if
self
.
type
and
not
self
.
type
.
is_pyobject
:
return
False
return
False
if
self
.
constant_result
not
in
(
not_a_constant
,
constant_value_not_set
):
if
self
.
constant_result
not
in
(
not_a_constant
,
constant_value_not_set
):
return
self
.
constant_result
is
not
None
return
self
.
constant_result
is
not
None
...
@@ -1530,7 +1530,7 @@ class NameNode(AtomicExprNode):
...
@@ -1530,7 +1530,7 @@ class NameNode(AtomicExprNode):
return
1
return
1
def
may_be_none
(
self
):
def
may_be_none
(
self
):
if
self
.
type
.
is_pyobject
and
self
.
cf_state
:
if
self
.
cf_state
and
self
.
type
and
self
.
type
.
is_pyobject
:
# gard against infinite recursion on self-dependencies
# gard against infinite recursion on self-dependencies
if
getattr
(
self
,
'_none_checking'
,
False
):
if
getattr
(
self
,
'_none_checking'
,
False
):
# self-dependency - either this node receives a None
# self-dependency - either this node receives a None
...
...
Cython/Compiler/FlowControl.py
View file @
bbc4c9e2
...
@@ -711,9 +711,7 @@ class CreateControlFlowGraph(CythonTransform):
...
@@ -711,9 +711,7 @@ class CreateControlFlowGraph(CythonTransform):
self
.
in_inplace_assignment
=
True
self
.
in_inplace_assignment
=
True
self
.
visitchildren
(
node
)
self
.
visitchildren
(
node
)
self
.
in_inplace_assignment
=
False
self
.
in_inplace_assignment
=
False
expr_node
=
node
.
create_binop_node
()
self
.
mark_assignment
(
node
.
lhs
,
node
.
create_binop_node
())
expr_node
.
type
=
expr_node
.
infer_type
(
self
.
env
)
self
.
mark_assignment
(
node
.
lhs
,
expr_node
)
return
node
return
node
def
visit_DelStatNode
(
self
,
node
):
def
visit_DelStatNode
(
self
,
node
):
...
...
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