internal object CheckSelf(CodeContext context, object self) { if (!PythonOps.IsInstance(context, self, im_class)) { throw BadSelf(self); } return self; }