Re: [Tutor] My first recursive function...

2005-07-28 Thread Liam Clarke
[key, info] you mean... Oops. That'd be the one. Looks good to me other than the name :-) I would call it toDict() or toNestedDict() maybe; IMO a function named isXXX should just return True or False.  Yah, it started off as a boolean return, and then I decided to go for the big one, so to speak,

Re: [Tutor] My first recursive function...

2005-07-28 Thread Andrei
Liam Clarke gmail.com> writes: > Are there any other pitfalls with recursion I need to watch for? Not just infinite recursion, but recursion that exceeds the maximum recursion depth (1000 on my system). You can add a counter parameter to your recursive function and stop recursing if the functio

Re: [Tutor] My first recursive function...

2005-07-28 Thread Kent Johnson
Liam Clarke wrote: > Just playing with my first recursive function, and just wanted your > experienced opinions on whether it's likely to blow up in my face, > as it all seems to work fine out of the gates, and that makes me a > little paranoid. > > For a given list - > > x = [ ['tag', 'CYP'],

[Tutor] My first recursive function...

2005-07-28 Thread Liam Clarke
Hi all, Spen too much time coding in VBA, so I'm now paranoid about any code I write. Just playing with my first recursive function, and just wanted your experienced opinions on whether it's likely to blow up in my face, as it all seems to work fine out of the gates, and that makes me a little pa