Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: <1989lzhh@gmail.com> X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.055 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'interpreter': 0.05; 'python': 0.11; 'def': 0.12; '2.7': 0.14; 'liu': 0.16; 'unbound': 0.16; 'fine': 0.24; 'pass': 0.26; 'function': 0.29; 'code': 0.31; 'thanks!': 0.32; 'received:google.com': 0.35; 'error.': 0.37; 'received:10': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'header:Message- Id:1': 0.63; 'iphone': 0.65; 'here': 0.66; 'charset:gb2312': 0.80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:content-type:message-id:date:to :content-transfer-encoding:mime-version; bh=S/5IM0K8Yf+L6thxrZjBFRjLXHgRb7meuBhmk8v0V9o=; b=GpUMFcikhS2KgL5zVIIuF21d7AZGi+3tNX67JZPK1enRdFxkjeSybJyRB5pyDlsX/5 +CBzYdB5ksBHUQYp7+8lwfy/2CQsrOxvxzI4GAwi9qFK5+2LdJWFVg6e0qoEyapDp4Ar Ftro4erDxeP1Rb9x96zJQh5BkU01e8bV6pRNYRIuYawJtABVDSxZaqbdbMkUDTXA8eqe BvGt00dTYXOMewqoz2/k2TXTlEwbHPgHk1qTqYFb51BtdF6JLpPZCacbvoDXXzGf2kj3 ELwQJoUJOIXdUEyVZlwAZCShnuxyLmEiEX6IZ7gA/bAe5De1bE6rVnAwOw8UhEYWc5qR RNjQ== X-Received: by 10.68.218.231 with SMTP id pj7mr11009569pbc.95.1402140201277; Sat, 07 Jun 2014 04:23:21 -0700 (PDT) Subject: strange behaivor of nested function From: 1989lzhh <1989lzhh@gmail.com> Content-Type: text/plain; charset=gb2312 X-Mailer: iPhone Mail (11D201) Date: Sat, 7 Jun 2014 19:17:23 +0800 To: python_list Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402140210 news.xs4all.nl 2927 [2001:888:2000:d::a6]:42250 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72910 here is code def make(): def jit(sig): def wrap(function): sig=3Dsig[0] # unbound local error, if change to sig=3D'' would b= e just fine return function=20 return wrap return jit jit=3Dmake() @jit('') def f(): pass It is strange that the interpreter complain about unbound local error.=20 please give me some suggestion, thanks! Ps: I am using python 2.7 Liu Zhenhai =20 =B7=A2=D7=D4=CE=D2=B5=C4 iPhone=