recursive function return value problems

Dan Sommers me at privacy.net
Wed Dec 28 19:05:05 EST 2005


On 28 Dec 2005 15:25:30 -0800,
randomtalk at gmail.com wrote:

> hi, i have the following recursive function (simplified to demonstrate
> the problem):

>>>> def reTest(bool):
> ... 	result = []
> ... 	if not bool:
> ... 		reTest(True)

Don't do that.  Do this instead:

                result = reTest(True)

[ rest of example snipped ]

HTH,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>



More information about the Python-list mailing list