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 local variable, and at this point it 
doesn't have a value yet.

Lua allows you to do this:

    sig = sig[0]

will look up a global sig and assign it to the local sig first, but that 
can be confusing and Python doesn't do that.



-- 
Steven D'Aprano
http://import-that.dreamwidth.org/
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to