assert is a reserved keyword in python and so it cannot be used as a function. So in python, there is a tricky gotcha where the following will not fail:
assert(1 == 2, "hello")
because it is equivalent to:
assert (1==2, "hello")
which is asserting the "truthiness" of a tuple, which is True.
However, in isopod we override the assert keyword to make it a function, so the two are equivalent.
This breaks python grammar rules, which affects the ability to re-use code formatting tools like black. It's also just confusing that something that the behavior is the opposite of the python behavior.
We should either fix the grammar to allow assert as a statement or use a different function name.
assert
is a reserved keyword in python and so it cannot be used as a function. So in python, there is a tricky gotcha where the following will not fail:because it is equivalent to:
which is asserting the "truthiness" of a tuple, which is
True
.However, in isopod we override the assert keyword to make it a function, so the two are equivalent.
This breaks python grammar rules, which affects the ability to re-use code formatting tools like
black
. It's also just confusing that something that the behavior is the opposite of the python behavior.We should either fix the grammar to allow assert as a statement or use a different function name.