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


Groups > comp.lang.python > #81805

Re: Proposed new conditional operator: "or else"

References <C2BEED98-4CCA-4EDE-8FDF-F235B478055C@panix.com>
From Zachary Ware <zachary.ware+pylist@gmail.com>
Date 2014-12-02 11:41 -0600
Subject Re: Proposed new conditional operator: "or else"
Newsgroups comp.lang.python
Message-ID <mailman.16496.1417542094.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith <roy@panix.com> wrote:
> Wouldn’t it be neat to write:
>
>    foo == 42 or else
>
> and have that be an synonym for:
>
>     assert foo == 42
>
> :-)

Never going to happen, but I like it!  Perhaps raise IntimidationError
instead of AssertionError when it fails?

-- 
Zach

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


Thread

Re: Proposed new conditional operator: "or else" Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-12-02 11:41 -0600
  Re: Proposed new conditional operator: "or else" Andrea D'Amore <anddamNOPSAM+gruppi@brapi.net> - 2014-12-02 22:41 +0100

csiph-web