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


Groups > comp.lang.python > #32077

Re: while expression feature proposal

Date 2012-10-25 09:56 +1100
From Cameron Simpson <cs@zip.com.au>
Subject Re: while expression feature proposal
References <CAPTjJmpnjKM_vk0HMCdQC6M0TPRbkWR87nLk3UNS7q9A4hNAeQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2804.1351119385.27098.python-list@python.org> (permalink)

Show all headers | 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