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
Boxiang Sun
cython
Commits
b02f373a
Commit
b02f373a
authored
Feb 21, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for non-loop usage of dict.iter*() methods
parent
90d7ebdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
tests/run/iterdict.pyx
tests/run/iterdict.pyx
+34
-0
No files found.
tests/run/iterdict.pyx
View file @
b02f373a
...
...
@@ -4,6 +4,40 @@ cimport cython
dict_size
=
4
d
=
dict
(
zip
(
range
(
10
,
dict_size
+
10
),
range
(
dict_size
)))
def
dict_iteritems
(
dict
d
):
"""
>>> it = dict_iteritems(d)
>>> type(it) is list
False
>>> sorted(it)
[(10, 0), (11, 1), (12, 2), (13, 3)]
"""
return
d
.
iteritems
()
def
dict_iterkeys
(
dict
d
):
"""
>>> it = dict_iterkeys(d)
>>> type(it) is list
False
>>> sorted(it)
[10, 11, 12, 13]
"""
return
d
.
iterkeys
()
def
dict_itervalues
(
dict
d
):
"""
>>> it = dict_itervalues(d)
>>> type(it) is list
False
>>> sorted(it)
[0, 1, 2, 3]
"""
return
d
.
itervalues
()
@
cython
.
test_fail_if_path_exists
(
"//WhileStatNode"
)
def
items
(
dict
d
):
...
...
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