Hi,
There is already a fail function, but it's not ergonomic to use, because it takes 2 lines and 1 added indentation level. It would be good if we could have a assert function. Consider:
if (not condition):
fail("Error message")
vs
assert(condition, "Error message")
The same code with assert is much cleaner. It's also consistent with most programming languages.
Hi,
There is already a
failfunction, but it's not ergonomic to use, because it takes 2 lines and 1 added indentation level. It would be good if we could have aassertfunction. Consider:vs
The same code with
assertis much cleaner. It's also consistent with most programming languages.