@@ -46,7 +46,11 @@ static OperatorMethod()
46
46
[ "op_LeftShift" ] = new SlotDefinition ( "__lshift__" , TypeOffset . nb_lshift ) ,
47
47
[ "op_RightShift" ] = new SlotDefinition ( "__rshift__" , TypeOffset . nb_rshift ) ,
48
48
[ "op_Modulus" ] = new SlotDefinition ( "__mod__" , TypeOffset . nb_remainder ) ,
49
- [ "op_OneComplement" ] = new SlotDefinition ( "__invert__" , TypeOffset . nb_invert )
49
+ [ "op_OneComplement" ] = new SlotDefinition ( "__invert__" , TypeOffset . nb_invert ) ,
50
+ [ "op_GreaterThan" ] = new SlotDefinition ( "__gt__" , TypeOffset . tp_richcompare ) ,
51
+ [ "op_GreaterThanOrEqual" ] = new SlotDefinition ( "__ge__" , TypeOffset . tp_richcompare ) ,
52
+ [ "op_LessThan" ] = new SlotDefinition ( "__lt__" , TypeOffset . tp_richcompare ) ,
53
+ [ "op_LessThanOrEqual" ] = new SlotDefinition ( "__le__" , TypeOffset . tp_richcompare )
50
54
} ;
51
55
}
52
56
@@ -137,15 +141,15 @@ public static string ReversePyMethodName(string pyName)
137
141
}
138
142
139
143
/// <summary>
140
- /// Check if the method is performing a forward or reverse operation.
144
+ /// Check if the method is performing a reverse operation.
141
145
/// </summary>
142
146
/// <param name="method">The operator method.</param>
143
147
/// <returns></returns>
144
- public static bool IsForward ( MethodInfo method )
148
+ public static bool IsReverse ( MethodInfo method )
145
149
{
146
150
Type declaringType = method . DeclaringType ;
147
151
Type leftOperandType = method . GetParameters ( ) [ 0 ] . ParameterType ;
148
- return leftOperandType = = declaringType ;
152
+ return leftOperandType ! = declaringType ;
149
153
}
150
154
151
155
public static void FilterMethods ( MethodInfo [ ] methods , out MethodInfo [ ] forwardMethods , out MethodInfo [ ] reverseMethods )
@@ -154,12 +158,12 @@ public static void FilterMethods(MethodInfo[] methods, out MethodInfo[] forwardM
154
158
List < MethodInfo > reverseMethodsList = new List < MethodInfo > ( ) ;
155
159
foreach ( var method in methods )
156
160
{
157
- if ( IsForward ( method ) )
161
+ if ( IsReverse ( method ) )
158
162
{
159
- forwardMethodsList . Add ( method ) ;
163
+ reverseMethodsList . Add ( method ) ;
160
164
} else
161
165
{
162
- reverseMethodsList . Add ( method ) ;
166
+ forwardMethodsList . Add ( method ) ;
163
167
}
164
168
165
169
}
0 commit comments