|
19 | 19 | public class itertools implements ClassDictInit { |
20 | 20 |
|
21 | 21 | public static final PyString __doc__ = new PyString( |
22 | | - "Functional tools for creating and using iterators.\n\nInfinite iterators:\n" |
23 | | - + "count([n]) --> n, n+1, n+2, ...\n" |
24 | | - + "cycle(p) --> p0, p1, ... plast, p0, p1, ...\n" |
25 | | - + "repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\n" |
26 | | - |
27 | | - + "Iterators terminating on the shortest input sequence:\n" |
28 | | - + "chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...\n" |
29 | | - + "compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\n" |
30 | | - + "dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\n" |
31 | | - + "groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)\n" |
32 | | - + "ifilter(pred, seq) --> elements of seq where pred(elem) is True\n" |
33 | | - + "ifilterfalse(pred, seq) --> elements of seq where pred(elem) is False\n" |
34 | | - + "islice(seq, [start,] stop [, step]) --> elements from seq[start:stop:step]\n" |
35 | | - + "imap(fun, p, q, ...) --> fun(p0, q0), fun(p1, q1), ...\n" |
36 | | - + "starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...\n" |
37 | | - + "tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n\n" |
38 | | - + "takewhile(pred, seq) --> seq[0], seq[1], until pred fails\n" |
39 | | - + "izip(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...\n" |
40 | | - + "izip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...\n\n" |
41 | | - |
42 | | - + "Combinatoric generators:\n" |
43 | | - + "product(p, q, ... [repeat=1]) --> cartesian product\n" |
44 | | - + "permutations(p[, r])\n" |
45 | | - + "combinations(p, r)\n" |
46 | | - + "combinations_with_replacement(p, r)"); |
| 22 | + "Functional tools for creating and using iterators.\n\nInfinite iterators:\n" + |
| 23 | + "count([n]) --> n, n+1, n+2, ...\n" + |
| 24 | + "cycle(p) --> p0, p1, ... plast, p0, p1, ...\n" + |
| 25 | + "repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\n" + |
| 26 | + |
| 27 | + "Iterators terminating on the shortest input sequence:\n" + |
| 28 | + "chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...\n" + |
| 29 | + "compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\n" + |
| 30 | + "dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\n" + |
| 31 | + "groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)\n" + |
| 32 | + "ifilter(pred, seq) --> elements of seq where pred(elem) is True\n" + |
| 33 | + "ifilterfalse(pred, seq) --> elements of seq where pred(elem) is False\n" + |
| 34 | + "islice(seq, [start,] stop [, step]) --> elements from seq[start:stop:step]\n" + |
| 35 | + "imap(fun, p, q, ...) --> fun(p0, q0), fun(p1, q1), ...\n" + |
| 36 | + "starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...\n" + |
| 37 | + "tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n\n" + |
| 38 | + "takewhile(pred, seq) --> seq[0], seq[1], until pred fails\n" + |
| 39 | + "izip(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...\n" + |
| 40 | + "izip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...\n\n" + |
| 41 | + |
| 42 | + "Combinatoric generators:\n" + |
| 43 | + "product(p, q, ... [repeat=1]) --> cartesian product\n" + |
| 44 | + "permutations(p[, r])\n" + |
| 45 | + "combinations(p, r)\n" + |
| 46 | + "combinations_with_replacement(p, r)"); |
47 | 47 |
|
48 | 48 | /** |
49 | 49 | * Iterator base class used by most methods. |
@@ -98,14 +98,6 @@ public static void classDictInit(PyObject dict) { |
98 | 98 | dict.__setitem__("initClassExceptions", null); |
99 | 99 | } |
100 | 100 |
|
101 | | - public static PyString __doc__islice = new PyString( |
102 | | - "islice(iterable, [start,] stop [, step]) --> islice object\n" |
103 | | - + "\nReturn an iterator whose next() method returns selected values from an\n" |
104 | | - + "iterable. If start is specified, will skip all preceding elements;\notherwise, start defaults to zero." |
105 | | - + "Step defaults to one. If\nspecified as another value, step determines how manyvalues are \n" |
106 | | - + "skipped between successive calls. Works like a slice() on a list\nbut returns an iterator."); |
107 | | - |
108 | | - |
109 | 101 | static int py2int(PyObject obj, int defaultValue, String msg) { |
110 | 102 | if (obj instanceof PyNone) { |
111 | 103 | return defaultValue; |
|
0 commit comments