Recusive function inside a function can't find itself.

Glyn Webster gdw at ninz.not.org.nz
Sat Oct 23 23:52:51 EDT 1999


In article <NDBBIAPHEKGOBIHCBLIIOEMJCAAA.mcfletch at vrtelecom.com>, "Mike Fletcher" <mcfletch at vrtelecom.com> wrote:
>Another approach:
>
>def x( r,b,g ):
>        def y( r,b,g, recurse ):
>                a,b,c = dosomething(r,b,g)
>                return recurse( a,b,c, recurse )
>        return y( r,b,g, y)
>
>Which is not really pretty (unless you're a devoted fan of 
>continuation passing I suppose), but should work :) .  Enjoy,
>Mike

Ah! The inner function is just another local variable of 
the outer function, so I'd have to pass it into the 
inner function's scope though its argument list, just like 
I did with all the others.  (I won't though. I'm going to 
make the inner function global like I'm being told to
before things get too silly :-)

--
(Remove the negation from my address to reply by email.)
"ThE oRigiN and SigNificaNce of thIs pRacTicE iS oBscuRe."




More information about the Python-list mailing list