Re: strange behaivor of nested function

2014-06-07 Thread Steven D'Aprano
On Sat, 07 Jun 2014 19:17:23 +0800, 1989lzhh wrote: > here is code > > def make(): > def jit(sig): > def wrap(function): > sig=sig[0] # unbound local error You are saying: "sig is a local variable. Assign sig to the value of sig[0]." But what is sig? You've said it is a

Re: strange behaivor of nested function

2014-06-07 Thread Chris Angelico
On Sat, Jun 7, 2014 at 9:17 PM, 1989lzhh <1989l...@gmail.com> wrote: > def make(): > def jit(sig): > def wrap(function): > sig=sig[0] # unbound local error, if change to sig='' would be > just fine > return function > return wrap > return jit > jit=m