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


Groups > comp.lang.python > #81805

Re: Proposed new conditional operator: "or else"

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <zachary.ware@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.173
X-Spam-Level *
X-Spam-Evidence '*H*': 0.68; '*S*': 0.02; 'happen,': 0.09; 'roy': 0.16; ':-)': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'raise': 0.29; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'assert': 0.31; 'but': 0.35; 'received:google.com': 0.35; 'subject:new': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'subject:"': 0.60; 'for:': 0.64; 'it!': 0.67; 'smith': 0.68; 'subject:else': 0.84; 'write:': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=GLo92CG5cVs+1gGS2wgBflsR4jg0u0wSTn0AVGdTTRY=; b=cxA3O1IJ6gl7OkUc06LazCyLtqHl+gfV8cXnsHa1Oub8VPB9hyrpRf8hSoxu0ZdZWk JRSSnUj3XvPID8GMp2h9W7G0cxROg2HFfpyx0cNKCC63s9EHG83DqsGegTtuwCP3kuP/ krswTTKGr23c8/H2+HVSoar45VOS/J7KPxSAzS3nkUep/DYdmRqYZBFAkbFnzq1U/EiV bNB5spciv7NTDK2ovsVGf3ivAMGs6mlIpctIXD2WeaF0hPA2nLLx7otbhOCoJgVvY2rn fppvwLVzb6i5T79Z85570XeJ56MxCBVSY/cta9sjGvieBIq5EGnrgQMA9MgVn8/xfwpP PSOA==
X-Received by 10.202.218.2 with SMTP id r2mr304639oig.82.1417542086187; Tue, 02 Dec 2014 09:41:26 -0800 (PST)
MIME-Version 1.0
Sender zachary.ware@gmail.com
In-Reply-To <C2BEED98-4CCA-4EDE-8FDF-F235B478055C@panix.com>
References <C2BEED98-4CCA-4EDE-8FDF-F235B478055C@panix.com>
From Zachary Ware <zachary.ware+pylist@gmail.com>
Date Tue, 2 Dec 2014 11:41:06 -0600
X-Google-Sender-Auth 1YGRtImJQ24GoTMiqplzSqIDg7s
Subject Re: Proposed new conditional operator: "or else"
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16496.1417542094.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417542094 news.xs4all.nl 2972 [2001:888:2000:d::a6]:47626
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81805

Show key headers only | 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