2007-02-22 | paulb | file changeset files shortlog | Added tentative ListComp, ListCompFor, ListCompIf and Sliceobj support. Changed pop-up element generation so that in cases where no information is available, the pop-up elements are not generated. Added a test of list comprehensions. Added a slice built-in type. |
paulb@201 | 1 | def f(x, y): |
paulb@201 | 2 | return x |
paulb@201 | 3 | |
paulb@201 | 4 | a = [1, 2, 3] |
paulb@201 | 5 | b = ["1", "2", "3"] |
paulb@201 | 6 | |
paulb@201 | 7 | l = [f(x, y) for x in a for y in b if y > "1" if x > 1] |