Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#17 assert 0

open
nobody
None
5
2003-12-17
2003-12-17
Richard Laager
No

As far as I know, it's common practice to place
statements of this sort where the code path should be
impossible:

assert 0, 'This should not happen.'

This helps catch logic errors if something is changed
later.

This currently triggers the constCond check. I'd like to
see an option to ignore assertions with a constant of
zero (or False). Assertions with a constant of 1 are
almost certainly an error, on the other hand.

Richard Laager
rlaager@users.sourceforge.net

Discussion