2 >>> type(smoketest_dict()) is dict
4 >>> type(smoketest_list()) is dict
7 >>> sorted(smoketest_dict().items())
8 [(2, 0), (4, 4), (6, 8)]
9 >>> sorted(smoketest_list().items())
10 [(2, 0), (4, 4), (6, 8)]
12 >>> list(typed().items())
13 [(A, 1), (A, 1), (A, 1)]
14 >>> sorted(iterdict().items())
15 [(1, 'a'), (2, 'b'), (3, 'c')]
25 @cython.test_fail_if_path_exists(
26 "//ComprehensionNode//ComprehensionAppendNode",
27 "//SimpleCallNode//ComprehensionNode")
28 @cython.test_assert_path_exists(
29 "//ComprehensionNode",
30 "//ComprehensionNode//DictComprehensionAppendNode")
32 return dict([ (x+2,x*2)
37 def __repr__(self): return u"A"
38 def __richcmp__(one, other, op): return one is other
39 def __hash__(self): return id(self) % 65536
43 return {obj:1 for obj in [A(), A(), A()]}
46 cdef dict d = dict(a=1,b=2,c=3)
47 return {d[key]:key for key in d}