Re: [Tutor] question about function inside of function

2010-01-10 Thread Kent Johnson
On Sat, Jan 9, 2010 at 8:03 AM, spir 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 pretty inexpensi

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 wrote: > > "Richard D. Moores" 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

Re: [Tutor] question about function inside of function

2010-01-09 Thread Alan Gauld
"Richard D. Moores" 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 other is... Reuse:

Re: [Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
On Sat, Jan 9, 2010 at 05:03, spir 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 options: http://mail.pyth

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 a

[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 p