Browse Source

Consider non-const overload before considering const overload in Python bindings

rdb 10 years ago
parent
commit
4c61db6374
1 changed files with 5 additions and 0 deletions
  1. 5 0
      dtool/src/interrogate/interfaceMakerPythonNative.cxx

+ 5 - 0
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -3992,6 +3992,11 @@ bool RemapCompareLess(FunctionRemap *in1, FunctionRemap *in2) {
   assert(in1 != NULL);
   assert(in1 != NULL);
   assert(in2 != NULL);
   assert(in2 != NULL);
 
 
+  if (in1->_const_method != in2->_const_method) {
+    // Non-const methods should come first.
+    return in2->_const_method;
+  }
+
   if (in1->_parameters.size() != in2->_parameters.size()) {
   if (in1->_parameters.size() != in2->_parameters.size()) {
     return (in1->_parameters.size() > in2->_parameters.size());
     return (in1->_parameters.size() > in2->_parameters.size());
   }
   }