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
34e5ca80
Commit
34e5ca80
authored
Dec 05, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case for dict iteration in list comprehensions
parent
e3dc3b21
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
tests/run/iterdict.pyx
tests/run/iterdict.pyx
+15
-0
No files found.
tests/run/iterdict.pyx
View file @
34e5ca80
...
...
@@ -55,6 +55,11 @@ def iteritems_tuple(dict d):
l
.
sort
()
return
l
def
iteritems_listcomp
(
dict
d
):
cdef
list
l
=
[(
k
,
v
)
for
k
,
v
in
d
.
iteritems
()]
l
.
sort
()
return
l
def
iterkeys
(
dict
d
):
l
=
[]
for
k
in
d
.
iterkeys
():
...
...
@@ -94,6 +99,11 @@ def iterdict_reassign(dict d):
l
.
sort
()
return
l
def
iterdict_listcomp
(
dict
d
):
cdef
list
l
=
[
k
for
k
in
d
]
l
.
sort
()
return
l
def
itervalues
(
dict
d
):
l
=
[]
for
v
in
d
.
itervalues
():
...
...
@@ -108,3 +118,8 @@ def itervalues_int(dict d):
l
.
append
(
v
)
l
.
sort
()
return
l
def
itervalues_listcomp
(
dict
d
):
cdef
list
l
=
[
v
for
v
in
d
.
itervalues
()]
l
.
sort
()
return
l
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