From 3ca3dfd13aa04eacbf670c9ffe6093d5a12f177f Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Apr 2019 17:10:52 +0200 Subject: [PATCH] interrogate: fix in-place or (|=) operators (see #588) --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index c617b6597e..dadd094ca4 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -431,6 +431,12 @@ get_slotted_function_def(Object *obj, Function *func, FunctionRemap *remap, return true; } + if (method_name == "operator |=") { + def._answer_location = "nb_inplace_or"; + def._wrapper_type = WT_inplace_binary_operator; + return true; + } + if (method_name == "__ipow__") { def._answer_location = "nb_inplace_power"; def._wrapper_type = WT_inplace_ternary_operator;