@@ -59,7 +59,7 @@ TPoint = class(TPersistent)
59
59
TPyPoint = class (TPyDelphiPersistent)
60
60
// Constructors & Destructors
61
61
constructor Create( APythonType : TPythonType ); override;
62
- constructor CreateWith( PythonType : TPythonType; args : PPyObject ); override;
62
+ constructor CreateWith(PythonType: TPythonType; args, kwds : PPyObject); override;
63
63
// Basic services
64
64
function Repr : PPyObject; override;
65
65
@@ -106,12 +106,20 @@ constructor TPyPoint.Create( APythonType : TPythonType );
106
106
// the Create constructor first, and because the constructors
107
107
// are virtual, TPyPoint.Create will be automatically be called.
108
108
109
- constructor TPyPoint.CreateWith( PythonType : TPythonType; args : PPyObject );
109
+ constructor TPyPoint.CreateWith(PythonType: TPythonType; args, kwds: PPyObject);
110
+ var
111
+ KeyArray: array of AnsiString;
112
+ KeyPointerArray: array of PAnsiChar;
110
113
begin
111
114
inherited ;
115
+ KeyArray := [' x' , ' y' ];
116
+ SetLength(KeyPointerArray, 3 );
117
+ KeyPointerArray[0 ] := PAnsiChar(KeyArray[0 ]);
118
+ KeyPointerArray[1 ] := PAnsiChar(KeyArray[1 ]);
112
119
with GetPythonEngine, DelphiObject as TPoint do
113
120
begin
114
- if PyArg_ParseTuple( args, ' ii:CreatePoint' ,@fx, @fy ) = 0 then
121
+ if PyArg_ParseTupleAndKeywords(args, kwds, ' ii:CreatePoint' ,
122
+ @KeyPointerArray[0 ], @fx, @fy) = 0 then
115
123
Exit;
116
124
end ;
117
125
end ;
0 commit comments