[EMAIL PROTECTED] wrote:
def mockit(): raise StopIteration
now pass mockit()


but it behaviors differenctly when pass in a mockit()  and pass in an
iterator with empty.  so i think the code emulates nothing.

Is it possible that what you really need is a generator function instead of just a regular one?

def mockit():
   raise StopIteration
   yield None

(The presence of the yield will let the compiler generate the
proper code for this to be a generator, but it will never
actually hit the yield statement when it executes...)

Just a thought.

-Peter
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to