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
adbafb64
Commit
adbafb64
authored
May 27, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
46434095
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
22 deletions
+1
-22
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+0
-21
tests/run/inlined_generator_expressions.pyx
tests/run/inlined_generator_expressions.pyx
+1
-1
No files found.
Cython/Compiler/Optimize.py
View file @
adbafb64
...
@@ -1287,27 +1287,6 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
...
@@ -1287,27 +1287,6 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
append_node
.
target
=
dictcomp
append_node
.
target
=
dictcomp
return
dictcomp
return
dictcomp
arg
=
pos_args
[
0
]
if
isinstance
(
arg
,
ExprNodes
.
ComprehensionNode
)
and
\
isinstance
(
arg
.
target
,
(
ExprNodes
.
ListNode
,
ExprNodes
.
SetNode
)):
append_node
=
arg
.
append
if
isinstance
(
append_node
.
expr
,
(
ExprNodes
.
TupleNode
,
ExprNodes
.
ListNode
))
and
\
len
(
append_node
.
expr
.
args
)
==
2
:
key_node
,
value_node
=
append_node
.
expr
.
args
target_node
=
ExprNodes
.
DictNode
(
pos
=
arg
.
target
.
pos
,
key_value_pairs
=
[])
new_append_node
=
ExprNodes
.
DictComprehensionAppendNode
(
append_node
.
pos
,
target
=
target_node
,
key_expr
=
key_node
,
value_expr
=
value_node
)
arg
.
target
=
target_node
arg
.
type
=
target_node
.
type
replace_in
=
Visitor
.
RecursiveNodeReplacer
(
append_node
,
new_append_node
)
return
replace_in
(
arg
)
return
node
# specific handlers for general call nodes
# specific handlers for general call nodes
def
_handle_general_function_dict
(
self
,
node
,
pos_args
,
kwargs
):
def
_handle_general_function_dict
(
self
,
node
,
pos_args
,
kwargs
):
...
...
tests/run/inlined_generator_expressions.pyx
View file @
adbafb64
...
@@ -145,5 +145,5 @@ def return_typed_sum_squares_start(seq, int start):
...
@@ -145,5 +145,5 @@ def return_typed_sum_squares_start(seq, int start):
>>> return_typed_sum_squares_start(range(10000), 9)
>>> return_typed_sum_squares_start(range(10000), 9)
333283335009
333283335009
"""
"""
cdef
int
i
cdef
long
i
return
<
long
>
sum
((
i
*
i
for
i
in
seq
),
start
)
return
<
long
>
sum
((
i
*
i
for
i
in
seq
),
start
)
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