}
object *
-newinstanceobject(class, arg)
+newinstanceobject(class, arg, kw)
object *class;
object *arg;
+ object *kw;
{
register instanceobject *inst;
object *init;
init = instance_getattr1(inst, "__init__");
if (init == NULL) {
err_clear();
- if (arg != NULL && !(is_tupleobject(arg) &&
- gettuplesize(arg) == 0)) {
+ if (arg != NULL && (!is_tupleobject(arg) ||
+ gettuplesize(arg) != 0) || kw != NULL) {
err_setstr(TypeError,
- "this classobject() takes no arguments");
+ "this constructor takes no arguments");
DECREF(inst);
inst = NULL;
}
}
else {
- object *res = call_object(init, arg);
+ object *res = PyEval_CallObjectWithKeywords(init, arg, kw);
DECREF(init);
if (res == NULL) {
DECREF(inst);
}
int
-getvarargs(op)
+getflags(op)
object *op;
{
if (!is_methodobject(op)) {
err_badcall();
return -1;
}
- return ((methodobject *)op) -> m_ml -> ml_flags & METH_VARARGS;
+ return ((methodobject *)op) -> m_ml -> ml_flags;
}
/* Methods (the standard built-in methods, that is) */