private Exception BadSelf(object got) {
OldClass dt = im_class as OldClass;
string firstArg;
if (got == null) {
firstArg = "nothing";
} else {
firstArg = PythonOps.GetPythonTypeName(got) + " instance";
}
PythonType pt = im_class as PythonType;
return PythonOps.TypeError("unbound method {0}() must be called with {1} instance as first argument (got {2} instead)",
Name,
(dt != null) ? dt.Name : (pt != null) ? pt.Name : im_class,
firstArg);
}