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
6c486666
Commit
6c486666
authored
May 14, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments
parent
541d268c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+4
-5
No files found.
Cython/Compiler/Optimize.py
View file @
6c486666
...
...
@@ -147,7 +147,7 @@ class IterationTransform(Visitor.VisitorTransform):
if
iterator
.
type
is
Builtin
.
dict_type
:
# like iterating over dict.keys()
if
reversed
:
#
(reversed) dict iteration uses arbitrary order
#
CPython raises an error here: not a sequence
return
node
return
self
.
_transform_dict_iteration
(
node
,
dict_obj
=
iterator
,
keys
=
True
,
values
=
False
)
...
...
@@ -167,7 +167,7 @@ class IterationTransform(Visitor.VisitorTransform):
if
isinstance
(
function
,
ExprNodes
.
AttributeNode
)
and
\
function
.
obj
.
type
==
Builtin
.
dict_type
:
if
reversed
:
#
(reversed) dict iteration uses arbitrary order
#
CPython raises an error here: not a sequence
return
node
dict_obj
=
function
.
obj
method
=
function
.
attribute
...
...
@@ -190,13 +190,12 @@ class IterationTransform(Visitor.VisitorTransform):
function
.
entry
and
function
.
entry
.
is_builtin
:
if
function
.
name
==
'enumerate'
:
if
reversed
:
#
TODO: implement
#
CPython raises an error here: not a sequence
return
node
return
self
.
_transform_enumerate_iteration
(
node
,
iterator
)
elif
function
.
name
==
'reversed'
:
if
reversed
:
# it is not safe to short-cut here due to evaluation rules,
# but this case is unlikely enough to just ignore it
# CPython raises an error here: not a sequence
return
node
return
self
.
_transform_reversed_iteration
(
node
,
iterator
)
...
...
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