mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
interrogate: Support __truediv__, __floordiv__, etc. special methods
This commit is contained in:
parent
18cb4a7ccc
commit
601ca323f5
@ -333,6 +333,18 @@ get_slotted_function_def(Object *obj, Function *func, FunctionRemap *remap,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (method_name == "__truediv__") {
|
||||
def._answer_location = "nb_true_divide";
|
||||
def._wrapper_type = WT_binary_operator;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (method_name == "__floordiv__") {
|
||||
def._answer_location = "nb_floor_divide";
|
||||
def._wrapper_type = WT_binary_operator;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (method_name == "operator %") {
|
||||
def._answer_location = "nb_remainder";
|
||||
def._wrapper_type = WT_binary_operator;
|
||||
@ -405,6 +417,18 @@ get_slotted_function_def(Object *obj, Function *func, FunctionRemap *remap,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (method_name == "__itruediv__") {
|
||||
def._answer_location = "nb_inplace_true_divide";
|
||||
def._wrapper_type = WT_binary_operator;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (method_name == "__ifloordiv__") {
|
||||
def._answer_location = "nb_inplace_floor_divide";
|
||||
def._wrapper_type = WT_binary_operator;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (method_name == "operator %=") {
|
||||
def._answer_location = "nb_inplace_remainder";
|
||||
def._wrapper_type = WT_inplace_binary_operator;
|
||||
|
Loading…
x
Reference in New Issue
Block a user