N
Narendra C. Tulpule
Hi,
is there any way to allow recusrion in compile()? Something like:
src_code = 'def fact(n):\n\tif n <= 1:\n\t\treturn 1\n\telse:' + \
'\n\t\treturn n * fact(n-1)\n\nprint fact(12)\n'
cobj = compile(src_code, 'myfile', 'exec')
eval(cobj)
I did a search on 'recursion' in comp.lang.python but didn't turn up
anything relevant. Maybe I've highhhhhh expectations
-- Naren.
is there any way to allow recusrion in compile()? Something like:
src_code = 'def fact(n):\n\tif n <= 1:\n\t\treturn 1\n\telse:' + \
'\n\t\treturn n * fact(n-1)\n\nprint fact(12)\n'
cobj = compile(src_code, 'myfile', 'exec')
eval(cobj)
I did a search on 'recursion' in comp.lang.python but didn't turn up
anything relevant. Maybe I've highhhhhh expectations
-- Naren.