Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.10; 'anyway': 0.11; 'guilty': 0.16; 'module': 0.19; 'bit': 0.21; 'fine,': 0.22; 'defined': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'function': 0.30; 'received:google.com': 0.34; 'subject:?': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'suprise': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=hKQ9IQI5dkrgNZKKbuqGby2IfcI6Lw/WQlykLmr214Q=; b=AtZ6DxqAcRfWEX018O35tPwts5ddYy/cXKeHggnj6WwwNSJDQ/e5pKyXu4/iCecDPy 8AwLsrckF0ZgLJdYt6GcihFHqbood+M5LA3z/ct6YeIHRecYTtNXWbWlzmmMRs8slirX u8+rJ5UdBfvL9lfW96uc92ZKF0ncaaqNCZLxjv7BkB7VwxTV1VyV7E6Fbzk9QxB1JpQB 87MdLnKSaWLVmsa6K8sTsx+l3qxAXRHs325MvcLtkn2riiZ6vNLm/MI0bqbSy7aon3Dc F5Xj6i3zGKRc8o61WC4Aids5aB5v+TM1kWah9ibeQ4KdvBLT7/psu8fs5debKrWKTzX/ aM5A== MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 30 Nov 2012 16:05:40 +0000 Subject: Re: amazing scope? From: andrea crotti To: Ulrich Eckhardt Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org 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: 7 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1354291543 news.xs4all.nl 6910 [2001:888:2000:d::a6]:60481 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34098 Well I knew that this works fine, even if I feel a bit guilty to do this, and better is: foo = 'bar' if some_condition else 'baz' Anyway for me the suprise is that something that is defined *later* at the module scope is found in a function which is defined *earlier*.