Brock Pytlik wrote:
[email protected] wrote:
On Mon, Sep 21, 2009 at 01:46:41PM -0700, Brock Pytlik wrote:
Can I get one more person to look at this? I'd like to get this in before I put my file layout stuff out for review because it depends on these changes.

Thanks,
Brock

Brock Pytlik wrote:
Webrev:
http://cr.opensolaris.org/~bpytlik/ips-11400-v1/

Most of this looks fine.  I'm curious if the assertions in image.py on
lines 170-173 should be assertions, though.  Would it be better to raise
an exception with a more detailed error message, or is this just a
sanity check?  My concern is that callers of image.__init__ will get an
assertion failure instead of a ValueError, or some kind of custom
exception, that might be more informative.

-j
My thinking on the assertions (instead of exceptions) is that image.__init__ is entirely inside the API, and isn't affected by user input at all. The only way we could hit this would be buggy code that we own. I thought that sounded like an assertion, rather than an exception, but I'll admit I'm not totally sure where we draw the distinction.

I just discussed this with Bart. My personal conclusion (and his as I interpret it) is that for now, we should use assertions for our own internal coding errors unless it is somehow beneficial to do otherwise (such as providing additional useful information that can't be provided through an assertion). In addition, we should probably open a bug about this and determine what our strategy is going forward. Especially in light of the fact that asserts are optimised out if python is run with -O, etc.

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to