question about generators

Andrew Koenig ark at research.att.com
Wed Aug 14 17:27:27 EDT 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>
               else:
                       <do something>
                       f()
                       <do something else>

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list