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


Groups > comp.lang.python > #81805 > unrolled thread

Re: Proposed new conditional operator: "or else"

Started byZachary Ware <zachary.ware+pylist@gmail.com>
First post2014-12-02 11:41 -0600
Last post2014-12-02 22:41 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

#81805 — Re: Proposed new conditional operator: "or else"

FromZachary Ware <zachary.ware+pylist@gmail.com>
Date2014-12-02 11:41 -0600
SubjectRe: Proposed new conditional operator: "or else"
Message-ID<mailman.16496.1417542094.18130.python-list@python.org>
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

[toc] | [next] | [standalone]


#81813

FromAndrea D'Amore <anddamNOPSAM+gruppi@brapi.net>
Date2014-12-02 22:41 +0100
Message-ID<m5lblc$6mq$1@virtdiesel.mng.cu.mi.it>
In reply to#81805
On 2014-12-02 17:41:06 +0000, Zachary Ware said:

>> foo == 42 or else

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

That should probably be a DONTPANICError in large, friendly terminal 
font letters.

-- 
Andrea

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web