Hi, I might understand why this does not work, but I am not convinced it should not - following:
def nnn(): print 'inside' yield 1 def nn(): def _nn(): print 'inside' yield 1 print 'before' _nn() print 'after' for i in nnn(): print i for i in nn(): print i gives results: $ python f.py inside 1 before after Traceback (most recent call last): File "f.py", line 18, in ? for i in nn(): TypeError: iteration over non-sequence while I would expect: $ python f.py inside 1 before inside 1 after Any insight? andy -- http://mail.python.org/mailman/listinfo/python-list