In article <52b90263$0$30003$c3e8da3$54964...@news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote:

> Roy Smith wrote:
> 
> > So, here's the deeper question.  Is your issue strictly that -O elides
> > assert statements?  That's a purely mechanical issue that could be
> > solved by using the rather more verbose:
> > 
> > if not condition:
> >     raise AssertionError("....")
> > 
> > Would you feel differently then?
> 
> 
> Not quite. As I said in my initial rant, there's also the issue of using an
> appropriate exception.
> [...]
> If I think that the test is checking an internal invariant, assert is okay,
> if not, it isn't.

Well, in this case, that's what it's doing, so I guess I'm good :-)
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to