Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32066

while expression feature proposal

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 <dloewenherz@gmail.com>
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 <dloewenherz@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2795.1351111299.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

while expression feature proposal Dan Loewenherz <dloewenherz@gmail.com> - 2012-10-24 13:40 -0700
  Re: while expression feature proposal Paul Rubin <no.email@nospam.invalid> - 2012-10-24 15:19 -0700

csiph-web