Hi,

Using generator recursively is not doing what I expect:

def test_gen(x):
   yield x
   x = x - 1
   if x != 0:
       test_gen(x)

for item in test_gen(3):
   print item


This gives me a single number 3 and not printing 2 and 1 as I would expect.

What is wrong??

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

Reply via email to