Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python': 0.09; 'before.': 0.09; 'subject:while': 0.09; 'assignment.': 0.16; 'expr': 0.16; 'subject:expression': 0.16; 'syntactic': 0.16; 'duplicate': 0.17; 'variable': 0.20; 'proposed': 0.20; 'all,': 0.21; 'bit': 0.21; 'mention': 0.23; 'possibility': 0.27; 'message- id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'run': 0.28; 'post': 0.28; 'archives': 0.29; 'dan': 0.29; "i'm": 0.29; 'curious': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'best,': 0.37; 'received:209': 0.37; 'sure': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'first': 0.61; 'due': 0.66; 'felt': 0.75 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=ILVht1SByenzfZNrtktUbnP6sZnQeom9bkZ1YV+4dOE=; b=tjKVlm6kIUvULOs63sjWfIkFm2Mfl78j4nizAz0tjt9cVGxcmcHoPVd6xhAWQk0RCW cvbyeXfmfnDd1F+6BOP1SzO6pzQG03n/Y+IQx4hhM8NQQYsCKdifOgLXFSmejdKSiUm1 rmmEztC4i6aopmaC+zR7Bsbp/zg+FzaoZm+eXoU6NQUw/OE2rOtge/K8iiKEJMVugL1g oe4VfCU7ETZTKCrGsmOxDjY/C5lz5mvQZvZOxdnApMzQTnArJA3ODAVQCyz9Swllxelg slINtnbUySi9Dz9yV6vI3edu5f7gKa6P6vw282FeFFfIv8DxrF/SNXvyPwRDgJjOv8XJ JHmw== MIME-Version: 1.0 From: Dan Loewenherz Date: Wed, 24 Oct 2012 13:40:57 -0700 Subject: while expression feature proposal To: python-list@python.org Content-Type: text/plain; charset=UTF-8 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351111299 news.xs4all.nl 6930 [2001:888:2000:d::a6]:33321 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32066 Hi all, This is my first post to this group--I'm not subscribed, so please CC me in responses. So I'm sure a lot of you have run into the following pattern. I use it all the time and it always has felt a bit awkward due to the duplicate variable assignment. VAR = EXPR while VAR: BLOCK VAR = EXPR I'm curious what the possibility of adding the following to Python as syntactic sugar: while EXPR as VAR: BLOCK Apologies if that has been proposed before. I searched the archives and couldn't find any mention of it. Best, Dan