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


Groups > comp.lang.python > #32077

Re: 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 <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'convenience': 0.09; 'subject:while': 0.09; 'cc:addr:python-list': 0.10; '"m"': 0.16; '-0.': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'oct': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:edu.au': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'simpson': 0.16; 'smart,': 0.16; 'subject:expression': 0.16; 'syntax.': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'suggested': 0.20; 'assignment': 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; 'header :User-Agent:1': 0.26; 'am,': 0.27; 'core': 0.27; "doesn't": 0.28; 'chris': 0.28; "i'm": 0.29; 'stuff': 0.30; 'could': 0.32; 'ryan': 0.33; 'languages': 0.33; 'another': 0.33; 'said,': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'received:au': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'where': 0.40; 'content-disposition:inline': 0.60; 'results': 0.65; 'as:': 0.75; 'tok': 0.84
Date Thu, 25 Oct 2012 09:56:22 +1100
From Cameron Simpson <cs@zip.com.au>
To Chris Angelico <rosuav@gmail.com>
Subject Re: while expression feature proposal
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <CAPTjJmpnjKM_vk0HMCdQC6M0TPRbkWR87nLk3UNS7q9A4hNAeQ@mail.gmail.com>
User-Agent Mutt/1.5.21 (2010-09-15)
References <CAPTjJmpnjKM_vk0HMCdQC6M0TPRbkWR87nLk3UNS7q9A4hNAeQ@mail.gmail.com>
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 <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.2804.1351119385.27098.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1351119385 news.xs4all.nl 6903 [2001:888:2000:d::a6]:59095
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:32077

Show key headers only | View raw


On 25Oct2012 09:40, Chris Angelico <rosuav@gmail.com> wrote:
| On Thu, Oct 25, 2012 at 9:26 AM, Cameron Simpson <cs@zip.com.au> wrote:
| > If I could write this as:
| >
| >   if re_FUNKYPATTERN.match(test_string) as m:
| >     do stuff with the results of the match, using "m"
| 
| Then you'd be right there with C-like languages where assignment is an
| expression :)
| 
| while (tok = strtok(blah,blah)) ... do something with tok ...

Well, yes, that's the core convenience of the suggested syntax.
But without the =/== accident opportunity.
But with another assignment that doesn't look like an asisgnment syntax.

Like I said, I'm -0.
-- 
Cameron Simpson <cs@zip.com.au>

Be smart, be safe, be paranoid.
        - Ryan Cousineau, courier@compdyn.com DoD#863, KotRB, KotKWaWCRH

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


Thread

Re: while expression feature proposal Cameron Simpson <cs@zip.com.au> - 2012-10-25 09:56 +1100

csiph-web