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;
78677867 Result := 0 ;
78687868end ;
78697869
7870+
78707871function 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 );
78737889end ;
78747890
78757891function TPyObject.Iter : PPyObject;
You can’t perform that action at this time.
0 commit comments