[Python-ideas] raise in lambda

Soni L. fakedme+py at gmail.com
Tue Nov 28 14:03:08 EST 2017


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.


More information about the Python-ideas mailing list