@@ -351,13 +351,13 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth
351
351
int clrnargs = pi . Length ;
352
352
isOperator = isOperator && pynargs == clrnargs - 1 ; // Handle mismatched arg numbers due to Python operator being bound.
353
353
// Preprocessing pi to remove either the first or second argument.
354
- bool isForward = isOperator && OperatorMethod . IsForward ( ( MethodInfo ) mi ) ; // Only cast if isOperator.
355
- if ( isOperator && isForward ) {
354
+ bool isReverse = isOperator && OperatorMethod . IsReverse ( ( MethodInfo ) mi ) ; // Only cast if isOperator.
355
+ if ( isOperator && ! isReverse ) {
356
356
// The first Python arg is the right operand, while the bound instance is the left.
357
357
// We need to skip the first (left operand) CLR argument.
358
358
pi = pi . Skip ( 1 ) . Take ( 1 ) . ToArray ( ) ;
359
359
}
360
- else if ( isOperator && ! isForward ) {
360
+ else if ( isOperator && isReverse ) {
361
361
// The first Python arg is the left operand.
362
362
// We need to take the first CLR argument.
363
363
pi = pi . Take ( 1 ) . ToArray ( ) ;
@@ -377,10 +377,10 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth
377
377
{
378
378
// Postprocessing to extend margs.
379
379
var margsTemp = new object [ 2 ] ;
380
- // If forward , the bound instance is the left operand.
381
- int boundOperandIndex = isForward ? 0 : 1 ;
382
- // If forward , the passed instance is the right operand.
383
- int passedOperandIndex = isForward ? 1 : 0 ;
380
+ // If reverse , the passed instance is the left operand.
381
+ int passedOperandIndex = isReverse ? 0 : 1 ;
382
+ // If reverse , the bound instance is the right operand.
383
+ int boundOperandIndex = isReverse ? 1 : 0 ;
384
384
margsTemp [ boundOperandIndex ] = co . inst ;
385
385
margsTemp [ passedOperandIndex ] = margs [ 0 ] ;
386
386
margs = margsTemp ;
0 commit comments