4 ms·
Sorry, I'm not deeply familiar with the Python spec. Outside of C or a lisp I would expect assert to behave more like a function which discards its arguments wh
by anonymoushn 13y ago
Sorry, I'm not deeply familiar with the Python spec. Outside of C or a lisp I would expect assert to behave more like a function which discards its arguments when disabled and less like a macro which stops evaluating its arguments when disabled. This expectation would obviously be incorrect in the case of Python, which is fairly explicit as to the meaning of assert[0]:
if __debug__:
if not expression: raise AssertionError
My mistake!
[0]: http://docs.python.org/2/reference/simple_stmts.html#the-assert-statement http://docs.python.org/2/reference/simple_stmts.html#the-ass...
- deleted 13y ago[deleted]