Commit 5c55c308 authored by Stefan Behnel's avatar Stefan Behnel

new test case for reassigning the dict variable during iteration

parent 5e19cbac
......@@ -16,6 +16,8 @@ __doc__ = u"""
[10, 11, 12, 13]
>>> iterdict(d)
[10, 11, 12, 13]
>>> iterdict_reassign(d)
[10, 11, 12, 13]
>>> iterdict_int(d)
[10, 11, 12, 13]
>>> itervalues(d)
......@@ -83,6 +85,15 @@ def iterdict_int(dict d):
l.sort()
return l
def iterdict_reassign(dict d):
cdef dict d_new = {}
l = []
for k in d:
d = d_new
l.append(k)
l.sort()
return l
def itervalues(dict d):
l = []
for v in d.itervalues():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment