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


Groups > comp.lang.python > #82410

Re: Extension of while syntax

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Extension of while syntax
Date 2014-12-12 14:14 +1100
References <14d2b880-3837-4267-a769-33ae7393f78b@googlegroups.com> <857fxxfv9u.fsf@benfinney.id.au> <019f01d015b7$a2da0520$e88e0f60$@us>
Newsgroups comp.lang.python
Message-ID <mailman.16890.1418354073.18130.python-list@python.org> (permalink)

Show all headers | View raw


(Please don't top-post; instead, interleave responses inline with the
quoted material and trim the excess. See
<URL:https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>.)

"Clayton Kirkwood" <crk@godblessthe.us> writes:

> I would prefer:
> while value = initial_value in undesired_values:
>         value = get_some_value()

The easy confusion between ‘=’ and ‘==’ in a condition is sufficient
that Python doesn't allow the ‘=’ operation in an expression.

I think that the subtle errors avoided by that is worth the loss of
expressions like the above.

-- 
 \          “Pity the meek, for they shall inherit the earth.” —Donald |
  `\                                              Robert Perry Marquis |
_o__)                                                                  |
Ben Finney

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


Thread

Extension of while syntax Nelson Crosby <nc@sourcecomb.com> - 2014-12-11 18:21 -0800
  Re: Extension of while syntax Ben Finney <ben+python@benfinney.id.au> - 2014-12-12 13:37 +1100
  Re: Extension of while syntax Chris Angelico <rosuav@gmail.com> - 2014-12-12 13:38 +1100
    Re: Extension of while syntax Marko Rauhamaa <marko@pacujo.net> - 2014-12-12 09:10 +0200
      Re: Extension of while syntax Chris Angelico <rosuav@gmail.com> - 2014-12-12 18:38 +1100
        Re: Extension of while syntax Marko Rauhamaa <marko@pacujo.net> - 2014-12-12 10:25 +0200
      Re: Extension of while syntax cl@isbd.net - 2014-12-12 09:09 +0000
        Re: Extension of while syntax Marko Rauhamaa <marko@pacujo.net> - 2014-12-12 12:33 +0200
  RE: Extension of while syntax "Clayton Kirkwood" <crk@godblessthe.us> - 2014-12-11 18:59 -0800
  Re: Extension of while syntax Terry Reedy <tjreedy@udel.edu> - 2014-12-11 22:00 -0500
  Re: Extension of while syntax Ben Finney <ben+python@benfinney.id.au> - 2014-12-12 14:14 +1100
  Re: Extension of while syntax Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-12-12 08:00 +0000
  Re: Extension of while syntax Chris Angelico <rosuav@gmail.com> - 2014-12-12 19:05 +1100
  Re: Extension of while syntax Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-12 11:38 -0500
  Re: Extension of while syntax Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-13 22:56 +1100

csiph-web