question about generators

Andrew Koenig ark at
Wed Aug 14 23:27:27 CEST 2002

Jonathan> I'm confused, the pattern you show above will only ever
Jonathan> 'print <something>' once.

You're quite right.  I really meant this:

       def f():
           for <...>
               if <condition>:
                       print <something>
                       <do something>
                       <do something else>

Andrew Koenig, ark at,

More information about the Python-list mailing list