Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'function,': 0.07; 'subject:parameters': 0.09; 'pm,': 0.10; 'received:209.85.214.174': 0.14; 'received:mail- iw0-f174.google.com': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'curious,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'namespace.': 0.16; 'namespace?': 0.16; 'subject:function': 0.16; "wouldn't": 0.17; 'header:In-Reply- To:1': 0.21; 'found,': 0.23; 'code': 0.24; 'example': 0.27; "i'm": 0.27; 'message-id:@mail.gmail.com': 0.28; 'raise': 0.28; 'received:209.85.214': 0.28; 'sun,': 0.30; 'steven': 0.32; 'to:addr:python-list': 0.33; "i've": 0.33; 'chris': 0.34; "d'aprano": 0.35; 'trigger': 0.35; 'assigned': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.37; 'subject:: ': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.39; '10:47': 0.84; 'now...': 0.84; 'this...': 0.84; 'local,': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=RavHusu7IUXpwRCOKzbbu8yvXH/rEqzKVuxQq9cu2UM=; b=mcWMO8WPqjQaQuZEh10/r1lgb2yOwtBqDXnfPzSdAYhH8Z4H+HzI3LxS3cTlPGrihY D/geXtOCsO3smkt9lZpdNzCgwHI9VnD/c/W/b0ZwhPiIPepT/foY179IQEcEXF/2Qmv/ eptez6pnZTV8RdYqlvAVRN21C/5zy020vwbtk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=c7irTiFsQalDD3DYXwtR0LRed4xHJSuHEcp7eYzPwwRB+baYc7e0i8sSwce8Te1NE4 UpelRjlPU4Xy9dF9I7lf1S082NC8C1SA7kyRllbbpXZJ9sN+wxA9hQQFWR2X2w8saV+G HaptwaMKeUzR075/PGJJ9tnT16li5pcM9WuUw= MIME-Version: 1.0 In-Reply-To: <4de24045$0$29996$c3e8da3$5496439d@news.astraweb.com> References: <4de24045$0$29996$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 30 May 2011 03:53:24 +1000 Subject: Re: scope of function parameters From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 13 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1306691608 news.xs4all.nl 49045 [::ffff:82.94.164.166]:59580 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6555 On Sun, May 29, 2011 at 10:47 PM, Steven D'Aprano wrote: > If a name is assigned to anywhere in the function, treat it as a local, > and look it up in the local namespace. If not found, raise > UnboundLocalError. > Wait wha? I've never seen this... wouldn't it just create it in the local namespace? Can you give example code that will trigger this error? I'm curious, now... Chris Angelico