File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
python4lazarus/Sources/Core Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -7867,9 +7867,25 @@ function TPyObject.Clear: integer;
7867
7867
Result := 0 ;
7868
7868
end ;
7869
7869
7870
+
7870
7871
function TPyObject.RichCompare ( obj : PPyObject; Op : TRichComparisonOpcode) : PPyObject;
7871
- begin
7872
- Result := nil ;
7872
+ Var
7873
+ Res : Boolean;
7874
+ begin
7875
+ Res := False;
7876
+ case Op of
7877
+ pyLT: Res := Compare(obj) < 0 ;
7878
+ pyLE: Res := Compare(obj) <= 0 ;
7879
+ pyEQ: Res := Compare(obj) = 0 ;
7880
+ pyNE: Res := Compare(obj) <> 0 ;
7881
+ pyGT: Res := Compare(obj) > 0 ;
7882
+ pyGE: Res := Compare(obj) >= 0 ;
7883
+ end ;
7884
+ if Res then
7885
+ Result := PPyObject(GetPythonEngine.Py_True)
7886
+ else
7887
+ Result := PPyObject(GetPythonEngine.Py_False);
7888
+ GetPythonEngine.Py_INCREF( Result );
7873
7889
end ;
7874
7890
7875
7891
function TPyObject.Iter : PPyObject;
You can’t perform that action at this time.
0 commit comments