Am I stupid or is 'assert' broken in Python 2.5??

dakman at gmail.com dakman at gmail.com
Wed Dec 6 14:02:21 EST 2006


The reason why it won't raise the AssertionError is because the
condition in the assert statement is a non-empty tuple, and its boolean
value would be True, not False, which is required to raise an assertion
error.

antred wrote:
> Yeah, it hit me seconds after I had posted my message. =0 Why didn't I
> think of it during the 30 minutes I spent banging my head against the
> keyboard going nuts over this 'bug' ...




More information about the Python-list mailing list