Would be useful to pass exception-raising lambdas around.

ensure(cond, lambda: raise TypeError())

I guess one could instead use (and raise in ensure())

ensure(cond, lambda: TypeError())

But I think exception-raising lambdas would be nicer.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to