Re: [sage-devel] Re: Opinion on "assert"

2012-09-25 Thread Nicolas M. Thiery
On Mon, Sep 24, 2012 at 07:10:01AM -0500, Jason Grout wrote: > On 9/24/12 3:55 AM, Nicolas M. Thiery wrote: > >That being said, if there is a way to raise ValueError in a way that > >can be turned off like for assertions, I am happy to change my mind! > >(I am missing this from MuPAD; we could even

[sage-devel] Re: Opinion on "assert"

2012-09-24 Thread Jason Grout
On 9/24/12 3:55 AM, Nicolas M. Thiery wrote: That being said, if there is a way to raise ValueError in a way that can be turned off like for assertions, I am happy to change my mind! (I am missing this from MuPAD; we could even change this at runtime which was really cool),. Of course, we can a

Re: [sage-devel] Re: Opinion on "assert"

2012-09-24 Thread Nicolas M. Thiery
On Mon, Sep 24, 2012 at 01:54:26AM -0700, Volker Braun wrote: >There is a temptation to use assert instead of "if ... raise >Exception(msg)" since its shorter and you don't have to write a good error >message. But then, that is exactly what is wrong with it: Instead of >getting an e

[sage-devel] Re: Opinion on "assert"

2012-09-24 Thread Volker Braun
Agreed. There is a temptation to use assert instead of "if ... raise Exception(msg)" since its shorter and you don't have to write a good error message. But then, that is exactly what is wrong with it: Instead of getting an error that'll point the user to what went wrong, there is just Assert