Especialized generator

Boogie El Aceitoso frr149 at telefonica.net
Thu Mar 4 10:03:13 EST 2004


On 4 Mar 2004 06:30:28 -0500, aahz at pythoncraft.com (Aahz) wrote:

>In article <hltd409mao1mmlk6kn5rjk00i5342p8pk6 at 4ax.com>,
>Boogie El Aceitoso  <frr149 at telefonica.net> wrote:
>>
>>I want to write a generator that specializes on os.walk. It should
>>yield only certain kinds of files.
>>
>>What's the best way of doing this? How do you save the state on the
>>base generator?
>
>You don't.  You write another generator that yields appropriate results
>from calling os.walk().  Chaining generators is *wonderful*.

I think I got it. And yes, it IS wonderful. :-)



More information about the Python-list mailing list