interrogate: support __int__ -> nb_int slot mapping

This commit is contained in:
rdb 2020-04-01 16:50:10 +02:00
parent e4819f2b5c
commit a34867ae4f

View File

@ -104,6 +104,7 @@ RenameSet methodRenameDictionary[] = {
{ "operator >>=" , "__irshift__", 1 },
{ "operator typecast bool", "__nonzero__", 0 },
{ "__nonzero__" , "__nonzero__", 0 },
{ "__int__" , "__int__", 0 },
{ "__reduce__" , "__reduce__", 0 },
{ "__reduce_persist__", "__reduce_persist__", 0 },
{ "__copy__" , "__copy__", 0 },
@ -557,6 +558,12 @@ get_slotted_function_def(Object *obj, Function *func, FunctionRemap *remap,
return true;
}
if (method_name == "__int__") {
def._answer_location = "nb_int";
def._wrapper_type = WT_no_params;
return true;
}
if (method_name == "__getbuffer__") {
def._answer_location = "bf_getbuffer";
def._wrapper_type = WT_getbuffer;