At first I thought the same thing about "O!" and "O?" from within
mkvalue(), but then I thought again. The purpose they serve is simply
one of type checking, just like in getargs(). It seems to me that if
you got a few object from somewhere and needed to pack them up into a
tuple for some reason,
t = mkvalue("(O!O?)", &Inttype, obj1, in_some_range, obj2);
if (! t)
return NULL;
is a bit nicer to read and write than
if (! isintobject(obj1) && ! in_some_range(obj2)) {
err_set_string(TypeError, "bogus objects")
return NULL;
}
t = mkvalue("(OO)", obj1, obj2);
if (! t)
return NULL;
In addition to having cleaner code, this allows mkvalue() to set up
the exception, which will gives the added bonus of more consistant
error messages.
-- Donald Beaudry DataViews Corporation Software Engineer 47 Pleasant Street don@dvcorp.com Northampton, MA 01060 "So much code, so little time..."