On Tue, May 8, 2018 at 12:29 AM, Eloi Gaudry <eloi.gau...@fft.be> wrote:
> On Mon, 2018-05-07 at 10:52 -0700, Guido van Rossum wrote: > > On Mon, May 7, 2018 at 6:24 AM, Serhiy Storchaka <storch...@gmail.com > > > wrote: > > > I just don't understand why you need a new keyword for writing > > > runtime checks. > > > > Oh, that's pretty clear. The OP wants to be able to turn these checks > > off with some flag he can set/clear at runtime, and when it's off he > > doesn't want to incur the overhead of evaluating the check. The > > assert statement has the latter property, but you have to use -O to > > turn it off. He basically wants a macro so that > > > > runtime_assert(<expr>) > > > > expands to > > > > if <controlling flag> and (<expr>): > > raise AssertionError > > > > In Lisp this would be easy. :-) > > and he already has a diff ready for review if needed (basically very > similar to the current 'assert' implementation :) That seems premature. There is not even a hint of agreement that such a feature would be useful *in general* (I'm not doubting your situation) and worth our limited volunteer developer resources to maintain, document etc. for decades to come. -- --Guido van Rossum (python.org/~guido)
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/