On 5/13/2020 10:40 AM, Rhodri James wrote:
On 13/05/2020 15:22, chris.the.develope...@gmail.com wrote:
How adverse would you guys feel about a change to the way asserts are
handled so that they are not recoverable? Asserts could latch on to
the first failed assert and always throw an AssertionError on
subsequent assert statements. Another way would be for subsequent
asserts to turn off after the first failure.
As long as developers keep the contract that asserts should never
fail, they wont notice this change; and it blocks developers from
writing code that is dependent on asserts.
I'm sorry, I don't see the use case. Unless by "writing code that is
dependent on asserts" you mean something I'm going to disapprove of
strongly :-)
Agreed.
Is the OP saying that if you catch the AssertError and continue, then
every assert after that would also raise an AssertError, even if the
condition were True? So if say I got an assertion in my user code and
ignored it, then assertions in (say) the stdlib would start throwing,
even if they otherwise wouldn't? You're linking together otherwise
unrelated things, and that doesn't seem desirable.
I don't see where this would be useful, but am willing to be proven wrong.
Eric
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/2QDN6X4KT5TBS25WE3YEF532DHQOVVTQ/
Code of Conduct: http://python.org/psf/codeofconduct/