Careful when using Python's `assert` statement: Normally you can use parentheses to wrap long lines in Python without using backslashes. For `assert` it doesn't work:

assert(some_condition,
"Some description")

This never fails, as Python's `assert` seens an `assert statement with a tuple as condition. This really has to be written like this:

assert some_condition, \
"Some description"

I just fell into that trap for you.

#Python #Assert #Mistakes

@taschenorakel the problem isn't that assert is somehow special, but that it's not a function but a statement like `if` and `else`. When you write `assert (x, y)`, you're saying "ensure that the tuple of these two values is True", which is always true.
@danielquinn Yup. It makes perfectly sense. It's just easy to fall for this trap if parenthesis-happy languages like C++ are your home ground.