Recusive function inside a function can't find itself.

Mike Fletcher mcfletch at vrtelecom.com
Sat Oct 23 12:39:25 EDT 1999


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

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Terry Reedy
Sent: October 23, 1999 10:12 AM
To: python-list at python.org
Subject: Re: Recusive function inside a function can't find itself.
...
No.  The easiest thing to do is move the definition of fill_code_list()
out of the body of display_codes() (perhaps with a leading underscore).
...





More information about the Python-list mailing list