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

In light of the parallel thread discussing the "assert" statement
and the perils of trusting it to be present even though it can be
optimized away, this "or else" could be (in the altered words of Don
Corleone), "I'm gonna make an assertion he can't refuse."

(not that I particularly want/expect this in the language definition,
but it's fun to entertain the idea)

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to