[SciPy-user] assign to diagonal values?
Thu Jan 31 09:43:21 CST 2008
On 31/01/2008, william ratcliff <firstname.lastname@example.org> wrote:
> Just curious--is it safe to use the assert statement for anything beyond
> debugging in case someone actually runs with optimization?
If debugging is turned off, then the condition in assert is not checked. So no.
More importantly, AssertionErrors *mean* that there is a bug in your
program. Not that it got invlaid input, not that it's out of some
resource, they mean your program has a bug. So it's okay to turn them
off if you're in a hurry, because a properly-working program never
signals AssertionError no matter what you feed it.
And really, how hard is it to replace
if not c: raise ValueError
More information about the SciPy-user