Showing
3 changed files
with
12 additions
and
1 deletions
... | @@ -24,4 +24,14 @@ except NameError : | ... | @@ -24,4 +24,14 @@ except NameError : |
24 | def next (obj) : | 24 | def next (obj) : |
25 | return obj.next() | 25 | return obj.next() |
26 | 26 | ||
27 | +try : | ||
28 | + unicode | ||
29 | +except NameError : | ||
30 | + unicode = str | ||
31 | + | ||
32 | +try : | ||
33 | + reduce | ||
34 | +except NameError : | ||
35 | + from functools import reduce | ||
36 | + | ||
27 | PY3 = sys.version > "3" | 37 | PY3 = sys.version > "3" | ... | ... |
... | @@ -2044,7 +2044,7 @@ class Place (Node) : | ... | @@ -2044,7 +2044,7 @@ class Place (Node) : |
2044 | """Iterate over the tokens in the place, including | 2044 | """Iterate over the tokens in the place, including |
2045 | repetitions. | 2045 | repetitions. |
2046 | 2046 | ||
2047 | - >>> p = Place('p', range(3)*2) | 2047 | + >>> p = Place('p', list(range(3))*2) |
2048 | >>> list(sorted([tok for tok in p])) | 2048 | >>> list(sorted([tok for tok in p])) |
2049 | [0, 0, 1, 1, 2, 2] | 2049 | [0, 0, 1, 1, 2, 2] |
2050 | 2050 | ... | ... |
... | @@ -5,6 +5,7 @@ from snakes.lang import unparse | ... | @@ -5,6 +5,7 @@ from snakes.lang import unparse |
5 | import snakes.utils.abcd.transform as transform | 5 | import snakes.utils.abcd.transform as transform |
6 | from snakes.data import MultiSet | 6 | from snakes.data import MultiSet |
7 | from snakes import * | 7 | from snakes import * |
8 | +from snakes.compat import * | ||
8 | 9 | ||
9 | class Decl (object) : | 10 | class Decl (object) : |
10 | OBJECT = "object" | 11 | OBJECT = "object" | ... | ... |
-
Please register or login to post a comment