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
900bffc3
Commit
900bffc3
authored
Apr 25, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve code readability
parent
64255591
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+21
-22
No files found.
Cython/Compiler/ExprNodes.py
View file @
900bffc3
...
...
@@ -6546,29 +6546,28 @@ class TupleNode(SequenceNode):
self
.
is_temp
=
False
self
.
is_literal
=
True
return
self
if
not
skip_children
:
self
.
args
=
[
arg
.
analyse_types
(
env
)
for
arg
in
self
.
args
]
if
not
self
.
mult_factor
and
not
any
((
arg
.
type
.
is_pyobject
or
arg
.
type
.
is_fused
)
for
arg
in
self
.
args
):
self
.
type
=
env
.
declare_tuple_type
(
self
.
pos
,
(
arg
.
type
for
arg
in
self
.
args
)).
type
self
.
is_temp
=
1
return
self
node
=
SequenceNode
.
analyse_types
(
self
,
env
,
skip_children
=
True
)
if
not
all
(
child
.
is_literal
for
child
in
node
.
args
):
return
node
if
not
node
.
mult_factor
or
(
node
.
mult_factor
.
is_literal
and
isinstance
(
node
.
mult_factor
.
constant_result
,
(
int
,
long
))):
node
.
is_temp
=
False
node
.
is_literal
=
True
else
:
if
not
skip_children
:
self
.
args
=
[
arg
.
analyse_types
(
env
)
for
arg
in
self
.
args
]
if
not
self
.
mult_factor
and
not
any
(
arg
.
type
.
is_pyobject
or
arg
.
type
.
is_fused
for
arg
in
self
.
args
):
self
.
type
=
env
.
declare_tuple_type
(
self
.
pos
,
(
arg
.
type
for
arg
in
self
.
args
)).
type
self
.
is_temp
=
1
return
self
else
:
node
=
SequenceNode
.
analyse_types
(
self
,
env
,
skip_children
=
True
)
for
child
in
node
.
args
:
if
not
child
.
is_literal
:
break
else
:
if
not
node
.
mult_factor
or
node
.
mult_factor
.
is_literal
and
\
isinstance
(
node
.
mult_factor
.
constant_result
,
(
int
,
long
)):
node
.
is_temp
=
False
node
.
is_literal
=
True
else
:
if
not
node
.
mult_factor
.
type
.
is_pyobject
:
node
.
mult_factor
=
node
.
mult_factor
.
coerce_to_pyobject
(
env
)
node
.
is_temp
=
True
node
.
is_partly_literal
=
True
return
node
if
not
node
.
mult_factor
.
type
.
is_pyobject
:
node
.
mult_factor
=
node
.
mult_factor
.
coerce_to_pyobject
(
env
)
node
.
is_temp
=
True
node
.
is_partly_literal
=
True
return
node
def
coerce_to
(
self
,
dst_type
,
env
):
if
self
.
type
.
is_ctuple
:
...
...
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