@@ -1828,7 +1828,7 @@ TPythonEngine = class(TPythonInterface)
18281828 function EvalStrings ( strings : TStrings; locals, globals : PPyObject ) : PPyObject; overload;
18291829 function EvalStringsAsStr ( strings : TStrings ) : string;
18301830 function EvalPyFunction (pyfunc, pyargs:PPyObject): Variant;
1831- function EvalFunction (pyfunc:PPyObject; args: array of const ): Variant;
1831+ function EvalFunction (pyfunc:PPyObject; const args: array of const ): Variant;
18321832 function EvalFunctionNoArgs (pyfunc:PPyObject): Variant;
18331833 function CheckEvalSyntax ( const str : AnsiString ) : Boolean;
18341834 function CheckExecSyntax ( const str : AnsiString ) : Boolean;
@@ -1844,19 +1844,19 @@ TPythonEngine = class(TPythonInterface)
18441844 function MethodsByName ( const aMethodsContainer: string ) : PPyMethodDef;
18451845 function VariantAsPyObject ( const V : Variant ) : PPyObject; virtual ;
18461846 function PyObjectAsVariant ( obj : PPyObject ) : Variant; virtual ;
1847- function VarRecAsPyObject ( v : TVarRec ) : PPyObject;
1847+ function VarRecAsPyObject ( const v : TVarRec ) : PPyObject;
18481848 function MakePyTuple ( const objects : array of PPyObject ) : PPyObject;
18491849 function MakePyList ( const objects : array of PPyObject ) : PPyObject;
1850- function ArrayToPyTuple ( items : array of const ) : PPyObject;
1851- function ArrayToPyList ( items : array of const ) : PPyObject;
1852- function ArrayToPyDict ( items : array of const ) : PPyObject;
1850+ function ArrayToPyTuple ( const items : array of const ) : PPyObject;
1851+ function ArrayToPyList ( const items : array of const ) : PPyObject;
1852+ function ArrayToPyDict ( const items : array of const ) : PPyObject;
18531853 function StringsToPyList ( strings : TStrings ) : PPyObject;
18541854 function StringsToPyTuple ( strings : TStrings ) : PPyObject;
18551855 procedure PyListToStrings ( list : PPyObject; strings : TStrings );
18561856 procedure PyTupleToStrings ( tuple: PPyObject; strings : TStrings );
18571857 function ReturnNone : PPyObject;
18581858 function FindModule ( const ModuleName : AnsiString ) : PPyObject;
1859- function FindFunction (ModuleName,FuncName: AnsiString): PPyObject;
1859+ function FindFunction (const ModuleName,FuncName: AnsiString): PPyObject;
18601860 function SetToList ( data : Pointer; size : Integer ) : PPyObject;
18611861 procedure ListToSet ( List : PPyObject; data : Pointer; size : Integer );
18621862 procedure CheckError (ACatchStopEx : Boolean = False);
@@ -2235,7 +2235,7 @@ TPythonModule = class(TMethodsContainer)
22352235 procedure AddClient ( client : TEngineClient );
22362236 function ErrorByName ( const AName : AnsiString ) : TError;
22372237 procedure RaiseError ( const error, msg : AnsiString );
2238- procedure RaiseErrorFmt ( const error, format : AnsiString; Args : array of const );
2238+ procedure RaiseErrorFmt ( const error, format : AnsiString; const Args : array of const );
22392239 procedure RaiseErrorObj ( const error, msg : AnsiString; obj : PPyObject );
22402240 procedure BuildErrors ;
22412241 procedure SetVar ( const varName : AnsiString; value : PPyObject );
@@ -4493,7 +4493,7 @@ function TPythonEngine.EvalPyFunction(pyfunc, pyargs:PPyObject): Variant;
44934493 end ;
44944494end ;
44954495
4496- function TPythonEngine.EvalFunction (pyfunc:PPyObject; args: array of const ): Variant;
4496+ function TPythonEngine.EvalFunction (pyfunc:PPyObject; const args: array of const ): Variant;
44974497var pargs: PPyObject;
44984498begin
44994499 CheckPython;
@@ -5017,7 +5017,7 @@ function TPythonEngine.ModuleByName( const aModuleName : AnsiString ) : PPyObj
50175017 raise Exception.CreateFmt(' Could not find module: %s' , [aModuleName]);
50185018end ;
50195019
5020- function TPythonEngine.MethodsByName ( const aMethodsContainer: string ) : PPyMethodDef;
5020+ function TPythonEngine.MethodsByName ( const aMethodsContainer: string ) : PPyMethodDef;
50215021var
50225022 i : Integer;
50235023begin
@@ -5361,7 +5361,7 @@ function TPythonEngine.PyObjectAsVariant( obj : PPyObject ) : Variant;
53615361 Result := Null;
53625362end ;
53635363
5364- function TPythonEngine.VarRecAsPyObject ( v : TVarRec ) : PPyObject;
5364+ function TPythonEngine.VarRecAsPyObject ( const v : TVarRec ) : PPyObject;
53655365begin
53665366 case v.VType of
53675367 vtInteger: Result := PyLong_FromLong( v.VInteger );
@@ -5448,7 +5448,7 @@ function TPythonEngine.MakePyList( const objects : array of PPyObject ) : PPyObj
54485448 end ;
54495449end ;
54505450
5451- function TPythonEngine.ArrayToPyTuple ( items : array of const ) : PPyObject;
5451+ function TPythonEngine.ArrayToPyTuple ( const items : array of const ) : PPyObject;
54525452var
54535453 i : Integer;
54545454begin
@@ -5459,7 +5459,7 @@ function TPythonEngine.ArrayToPyTuple( items : array of const) : PPyObject;
54595459 PyTuple_SetItem( Result, i, VarRecAsPyObject( items[i] ) );
54605460end ;
54615461
5462- function TPythonEngine.ArrayToPyList ( items : array of const ) : PPyObject;
5462+ function TPythonEngine.ArrayToPyList ( const items : array of const ) : PPyObject;
54635463var
54645464 i : Integer;
54655465begin
@@ -5471,9 +5471,9 @@ function TPythonEngine.ArrayToPyList( items : array of const) : PPyObject;
54715471end ;
54725472
54735473// You must give each entry as a couple key(string)/value
5474- function TPythonEngine.ArrayToPyDict ( items : array of const ) : PPyObject;
5474+ function TPythonEngine.ArrayToPyDict ( const items : array of const ) : PPyObject;
54755475
5476- function VarRecAsString ( v : TVarRec ) : AnsiString;
5476+ function VarRecAsString ( const v : TVarRec ) : AnsiString;
54775477 begin
54785478 case v.VType of
54795479 vtChar: Result := v.VChar;
@@ -5700,7 +5700,7 @@ function TPythonEngine.FindModule( const ModuleName : AnsiString ) : PPyObject;
57005700 Result := nil ;
57015701end ;
57025702
5703- function TPythonEngine.FindFunction (ModuleName,FuncName: AnsiString): PPyObject;
5703+ function TPythonEngine.FindFunction (const ModuleName,FuncName: AnsiString): PPyObject;
57045704var
57055705 module ,func: PPyObject;
57065706begin
@@ -6836,7 +6836,7 @@ procedure TPythonModule.RaiseError( const error, msg : AnsiString );
68366836 ErrorByName( error ).RaiseError( msg );
68376837end ;
68386838
6839- procedure TPythonModule.RaiseErrorFmt ( const error, format : AnsiString; Args : array of const );
6839+ procedure TPythonModule.RaiseErrorFmt ( const error, format : AnsiString; const Args : array of const );
68406840begin
68416841 RaiseError( error, AnsiString(SysUtils.Format( string(format), Args )) );
68426842end ;
0 commit comments