³ς ”,9Mc@s‘dZdZd„Zdd„Zd„Zd„Zd„Zd„Zd „Zd „Z d „Z d „Z d „Z d„Z d„Zd„ZdS(sJsrc/engine/SCons/compat/_scons_itertools.py 4629 2010/01/17 22:23:21 sconssΟ 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. cGs.g}x!|D]}|it|ƒƒq W|S(N(textendtlist(t iterablestresulttx((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytchain0s icCs t‚dS(N(tNotImplementedError(tn((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytcount6scCs t‚dS(N(R(titerable((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytcycle:scCsGg}x-|D]%}||ƒp|i|ƒPq q W|i|ƒ|S(N(tappendR(t predicateR RR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pyt dropwhile>s    cGs t‚dS(N(R(R targs((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytgroupbyGscCsPg}|djo t}nx,|D]$}||ƒo|i|ƒq$q$W|S(N(tNonetboolR (R R RR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytifilterJs   cCsPg}|djo t}nx,|D]$}||ƒp|i|ƒq$q$W|S(N(RRR (R R RR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pyt ifilterfalseSs   cGstt|ft|ƒƒS(N(tapplytmapttuple(tfunctionR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytimap\scOs t‚dS(N(R(Rtkw((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytislice_scGs tt|ƒS(N(Rtzip(R((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytizipbscOs t‚dS(N(R(RR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytrepeatescOs t‚dS(N(R(RR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytstarmapiscCs:g}x-|D]%}||ƒo|i|ƒq Pq W|S(N(R (R R RR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pyt takewhilels cOs t‚dS(N(R(RR((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pytteeusN(t __revision__t__doc__RRR R RRRRRRRRRR (((sBinstall/lib/scons-1.2.0.d20100117/SCons/compat/_scons_itertools.pyss