Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'feature,': 0.09; 'subject:design': 0.09; '__del__': 0.16; 'cleaned': 0.16; 'effect,': 0.16; 'exiting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; "object's": 0.16; 'personally,': 0.16; 'subject:Language': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'wed,': 0.18; 'references': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; 'sep': 0.31; 'open': 0.33; 'up.': 0.33; "i'd": 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'to:addr :python-list': 0.38; 'files': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'guarantee': 0.63; 'name': 0.63; 'within': 0.65; "'with'": 0.84; 'confusing': 0.84; 'destruction,': 0.84; 'rebert': 0.84; 'expires': 0.91; '2013': 0.98 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 :content-type; bh=ByM+1YatZEeoFbjqHtgAz9SPFML8IhFJsN52shgccGM=; b=XUXdS8KsLmsiAkQPJk7yEshmLsJkQLqcg1zaQ84tMrgsKNah9h8+p9oySLCECOkdnu dwmwaua4wPiIc9I0Bz4G6bk9GZyE7VtNj72YtydzTK20YxpuvhaLeARaiTOsUYcAgiZk 7x5ec+oE7naEa9nAxR+QNNCVWK2Zu9eG2Xi7diokhSJzHDIDePn7zeJPXo06M5iEiJ5Q i0hdBYxLVuOcmuoxaf0Ir7p1tUmHE8EBDpZia8/xN8yXRitMkKFQsbmKyM6xcqm6dD61 onm3FO4k8cTQijPhc2q7mK13/CVsQhPAjJWMorylsUSliIRPtf3H2+T8IwIIN9K9ZEND NvQA== MIME-Version: 1.0 X-Received: by 10.220.13.20 with SMTP id z20mr2209234vcz.0.1378873274805; Tue, 10 Sep 2013 21:21:14 -0700 (PDT) In-Reply-To: References: <522eb795$0$29999$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 11 Sep 2013 14:21:14 +1000 Subject: Re: Language design 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.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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378873283 news.xs4all.nl 15878 [2001:888:2000:d::a6]:44585 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53942 On Wed, Sep 11, 2013 at 11:46 AM, Chris Rebert wrote: > * The value of the loop variable at call-time for functions defined > within a loop trips people up. Related: The confusion of 'with' vs __del__ vs del wrt open files etc. Using 'with' does not guarantee the object's destruction, but the destruction of the object and the exiting of the with block do have the same effect, which is confusing. Personally, I'd prefer a guarantee that this name expires at this point, plus a guarantee that - if there are no other references - the object will be cleaned up immediately; it's generally true in CPython, and if that could actually be made a language feature, there'd be no need for 'with' and no issues with confusing people. ChrisA