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


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

Re: Proposed new conditional operator: "or else"

Started byEthan Furman <ethan@stoneleaf.us>
First post2014-12-02 10:06 -0800
Last post2014-12-02 10:06 -0800
Articles 1 — 1 participant

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" Ethan Furman <ethan@stoneleaf.us> - 2014-12-02 10:06 -0800

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

FromEthan Furman <ethan@stoneleaf.us>
Date2014-12-02 10:06 -0800
SubjectRe: Proposed new conditional operator: "or else"
Message-ID<mailman.16497.1417543599.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On 12/02/2014 09:41 AM, Zachary Ware wrote:
> On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith 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?

As long as when raising Intimidation, it also roughs up a couple surrounding lines as a warning to the rest of the code...

--
~Ethan~

[toc] | [standalone]


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


csiph-web