On Tue, Sep 7, 2021 at 8:37 AM Simão Afonso <
[email protected]> wrote:

> On 2021-09-07 11:12:37, Juancarlo Añez wrote:
> > Basically, the proposal is to allow for an exception type and value to be
> > specified in *assert*, instead of the customary:
> >
> > if not assertion:
> >     raise ValueError('a message')
>

what are you proposing instead? Maybe:

assert assertion, raise ValueError("a message")

(currently a syntax error)

in what way is that better than your original:

if not assertion:
    raise ValueError("a message")

or even:

if not assertion: raise ValueError("a message")

what is the value in the "assert" statement?

So why do we have athe at all? Because they ARE turned off by -OO :-)

-CHB

-- 
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/QTYTPHEBQCGISMUNJ7FCOVIFFNUBAD64/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to