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


Groups > comp.lang.python > #82414

Re: Extension of while syntax

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: Extension of while syntax
Date Fri, 12 Dec 2014 09:10:15 +0200
Organization A noiseless patient Spider
Lines 14
Message-ID <87r3w5gx7s.fsf@elektro.pacujo.net> (permalink)
References <14d2b880-3837-4267-a769-33ae7393f78b@googlegroups.com> <mailman.16886.1418351925.18130.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="12359"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LGl4WsNEH+qxSRBpRmoSP"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:3PRhhbg8/kVzcqqXkJh8LSSIkig= sha1:6Pqi+LDnMx4mnVUpHzCyMYygp/o=
Xref csiph.com comp.lang.python:82414

Show key headers only | View raw


Chris Angelico <rosuav@gmail.com>:

> You could deduplicate it by shifting the condition:
>
> while True:
>     value = get_some_value()
>     if value not in undesired_values: break
>
> But I'm not sure how common this idiom actually is.

Extremely common, and not only in Python.


Marko

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