Package SCons :: Package compat :: Module _scons_itertools
[hide private]
[frames] | no frames]

Module _scons_itertools

source code


Implementations of itertools functions for Python versions that don't
have iterators.

These implement the functions by creating the entire list, not returning
it element-by-element as the real itertools functions do.  This means
that early Python versions won't get the performance benefit of using
the itertools, but we can still use them so the later Python versions
do get the advantages of using iterators.

Because we return the entire list, we intentionally do not implement the
itertools functions that "return" infinitely-long lists: the count(),
cycle() and repeat() functions.  Other functions below have remained
unimplemented simply because they aren't being used (yet) and it wasn't
obvious how to do it.  Or, conversely, we only implemented those functions
that *were* easy to implement (mostly because the Python documentation
contained examples of equivalent code).

Note that these do not have independent unit tests, so it's possible
that there are bugs.



Functions [hide private]
 
chain(*iterables) source code
 
count(n=0) source code
 
cycle(iterable) source code
 
dropwhile(predicate, iterable) source code
 
groupby(iterable, *args) source code
 
ifilter(predicate, iterable) source code
 
ifilterfalse(predicate, iterable) source code
 
imap(function, *iterables) source code
 
islice(*args, **kw) source code
 
izip(*iterables) source code
 
repeat(*args, **kw) source code
 
starmap(*args, **kw) source code
 
takewhile(predicate, iterable) source code
 
tee(*args, **kw) source code
Variables [hide private]
  __revision__ = 'src/engine/SCons/compat/_scons_itertools.py 38...
  __doc__ = ...
Variables Details [hide private]

__revision__

Value:
'src/engine/SCons/compat/_scons_itertools.py 3842 2008/12/20 22:59:52 \
scons'

__doc__

Value:
"""
Implementations of itertools functions for Python versions that don't
have iterators.

These implement the functions by creating the entire list, not returni\
ng
it element-by-element as the real itertools functions do.  This means
that early Python versions won't get the performance benefit of using
...