Closed nstarman closed 11 months ago
I think a simple switch to if not X: raise AssertionError()
isn't removed by -O
. Want to make the switch?
I don't think we were using asserts there for any sensible reasons! I'd probably prefer to use this as an opportunity to raise more appropriate exception types :D
There's a few assert statements in the code, of which this is one:
https://github.com/daft-dev/daft/blob/33def2d6fd130d0e3376aa4902fee535d49a9e92/daft.py#L587-L589
Asserts are stripped in optimize mode (https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement), which can change the behaviour of a package.