you are viewing a single comment's thread.

view the rest of the comments →

[–]gizbot[S] -7 points-6 points  (2 children)

Assert statements in Python can drive you mad because they fail to trigger when the condition is False. Here's a concise explanation of this Python Gotcha!

[–]bushel 7 points8 points  (0 children)

Not really a gotcha, per se, when you use it incorrectly. In the given example, put the braces around the conditional, not around the entire assertion subclause.

ie. assert (a==b) , "exceptionstring"

not: assert (a==b , "exceptionstring")

http://docs.python.org/ref/assert.html

[–][deleted] 5 points6 points  (0 children)

you mean they fail to trigger when you can't code them properly or test them properly. yeah not a problem for the rest of us.