On 03/15/10 03:04 PM, [email protected] wrote:
On Fri, Mar 12, 2010 at 11:12:12PM -0600, Shawn Walker wrote:
webrev:
http://cr.opensolaris.org/~swalker/pkg-mem-2/

In general this looks good.  I do have a question about solver.py lines
171, 463, 526, and 563.  Since it's possible to run Python in a mode
where assertions are disabled and these checks appear to be executed for
correctness, should this raise a known exception type instead of
generating an AssertionError?  Or, to put it another way, do we want it
to be possible for the interpreter to disable these checks?

It's the recurring question we have for all our assertions.

With that said, my view at the moment is that assertions should only be used for checks that indicate consumer (caller) error. A well-behaved consumer should never trigger this assertion, so if the assertions are skipped, it shouldn't be an issue.

In this particular case, if the assertions were skipped, a traceback would just happen later in the routine since the required properties would be "None".

Nevertheless, thanks for asking.

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

Reply via email to