Re: [Tutor] question about function inside of function

2010-01-10 Thread Kent Johnson
On Sat, Jan 9, 2010 at 8:03 AM, spir denis.s...@free.fr wrote: Do you realize the inner func will be redefined before each call? Meaning in your case n calls x n outer loops x n inner loops.   def f() ... is actually a kind of masked assignment   f = function()... That's true, but it is

[Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
I'm working on a function that seems to cry out for some of its code to be put in a function. For convenience sake, I've put this new function inside the one that calls it. Question 1: Is this bad practice? It works fine that way, but.. Question 2: If the answer to Q1 is no, is there a standard

Re: [Tutor] question about function inside of function

2010-01-09 Thread spir
Richard D. Moores dixit: I'm working on a function that seems to cry out for some of its code to be put in a function. For convenience sake, I've put this new function inside the one that calls it. Question 1: Is this bad practice? It works fine that way, but.. Question 2: If the answer

Re: [Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
On Sat, Jan 9, 2010 at 05:03, spir denis.s...@free.fr wrote: Do you realize the inner func will be redefined before each call? Oh, I forgot about that. Thanks! Dick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] question about function inside of function

2010-01-09 Thread Alan Gauld
Richard D. Moores rdmoo...@gmail.com wrote to be put in a function. For convenience sake, I've put this new function inside the one that calls it. Question 1: Is this bad practice? It works fine that way, but.. No, but there are some issues to consider. Denis has addressed some but one

Re: [Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
On Sat, Jan 9, 2010 at 07:28, Alan Gauld alan.ga...@btinternet.com wrote: Richard D. Moores rdmoo...@gmail.com wrote to be put in a function. For convenience sake, I've put this new function inside the one that calls it. Question 1: Is this bad practice? It works fine that way, but.. No,