1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 __revision__ = "src/engine/SCons/compat/_scons_itertools.py 5110 2010/07/25 16:14:38 bdeegan"
25
26 __doc__ = """
27 Implementations of itertools functions for Python versions that don't
28 have iterators.
29
30 These implement the functions by creating the entire list, not returning
31 it element-by-element as the real itertools functions do. This means
32 that early Python versions won't get the performance benefit of using
33 the itertools, but we can still use them so the later Python versions
34 do get the advantages of using iterators.
35
36 Because we return the entire list, we intentionally do not implement the
37 itertools functions that "return" infinitely-long lists: the count(),
38 cycle() and repeat() functions. Other functions below have remained
39 unimplemented simply because they aren't being used (yet) and it wasn't
40 obvious how to do it. Or, conversely, we only implemented those functions
41 that *were* easy to implement (mostly because the Python documentation
42 contained examples of equivalent code).
43
44 Note that these do not have independent unit tests, so it's possible
45 that there are bugs.
46 """
47
53
55
56 raise NotImplementedError
57
59
60 raise NotImplementedError
61
70
72 raise NotImplementedError
73
82
91
92 -def imap(function, *iterables):
93 return apply(map, (function,) + tuple(iterables))
94
96 raise NotImplementedError
97
98 -def izip(*iterables):
99 return apply(zip, iterables)
100
102
103 raise NotImplementedError
104
106 raise NotImplementedError
107
116
117 -def tee(*args, **kw):
118 raise NotImplementedError
119
120
121
122
123
124
125