> "Duncan" == Duncan Booth <[EMAIL PROTECTED]> writes:
Duncan> Terry Jones <[EMAIL PROTECTED]> wrote:
>> Duncan Booth wrote:
Duncan> You'll kick yourself for not seeing it.
Duncan> If you changed fn_inner to:
Duncan> def fn_inner():
Duncan> a, v = v, a
Duncan> then you also changed 'a' and '
Terry Jones <[EMAIL PROTECTED]> wrote:
> Duncan Booth wrote:
>
>> You can use Python's bytecode disassembler to see what actually gets
>> executed here:
>>
>> >>> def fn_outer(v):
>> a=v*2
>> def fn_inner():
>> print "V:%d,%d" % (v,a)
>>
>> fn_inner()
>>
>> >>> import
[Referring to the thread at
http://mail.python.org/pipermail/python-list/2007-October/463348.html
with apologies for top posting (I don't have the original mail)]
Duncan Booth wrote:
> You can use Python's bytecode disassembler to see what actually gets
> executed here:
>
> >>> def fn_outer(v
On Oct 24, 2:52 am, Duncan Booth <[EMAIL PROTECTED]> wrote:
> beginner <[EMAIL PROTECTED]> wrote:
> > It is really convenient to use nested functions and lambda
> > expressions. What I'd like to know is if Python compiles fn_inner()
> > only once and change the binding of v every time fn_outer() is
beginner <[EMAIL PROTECTED]> wrote:
> It is really convenient to use nested functions and lambda
> expressions. What I'd like to know is if Python compiles fn_inner()
> only once and change the binding of v every time fn_outer() is called
> or if Python compile and generate a new function object e
"Gary Herron" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| beginner wrote:
| > Hi All,
| >
| > It is really convenient to use nested functions and lambda
| > expressions. What I'd like to know is if Python compiles fn_inner()
| > only once and change the binding of v every time f
On Oct 23, 11:06 am, Gary Herron <[EMAIL PROTECTED]> wrote:
> beginner wrote:
> > Hi All,
>
> > It is really convenient to use nested functions and lambda
> > expressions. What I'd like to know is if Python compiles fn_inner()
> > only once and change the binding of v every time fn_outer() is calle
beginner wrote:
> Hi All,
>
> It is really convenient to use nested functions and lambda
> expressions. What I'd like to know is if Python compiles fn_inner()
> only once and change the binding of v every time fn_outer() is called
> or if Python compile and generate a new function object every time
Hi All,
It is really convenient to use nested functions and lambda
expressions. What I'd like to know is if Python compiles fn_inner()
only once and change the binding of v every time fn_outer() is called
or if Python compile and generate a new function object every time. If
it is the latter, will