I have delphi object and wrapped class to use in python.
TEventFromScript = class(TInterfacedObject, IEventFromScript)
strict private
FData: string;
function GetData: string;
procedure SetData(const AValue: string);
public
property Data: string read GetData write SetData;
end;
TPyEventFromScript = class(TPyDelphiObject)
private
// Getter
function Get_Data(AContext: Pointer): PPyObject; cdecl;
// Setter
function Set_Data(AValue: PPyObject; AContext: Pointer): Integer; cdecl;
function GetDelphiObject: TEventFromScript;
procedure SetDelphiObject(const Value: TEventFromScript);
public
constructor CreateWith(APythonType: TPythonType; args, kwds: PPyObject); override;
class function DelphiObjectClass: TClass; override;
class procedure RegisterGetSets(PythonType: TPythonType); override;
// Properties
property DelphiObject: TEventFromScript read GetDelphiObject write SetDelphiObject;
end;
I can use in python wrapped TPyEventFromScript and it is ok. I can use TventFromScript in delphi.
But... at some point I need pass TEventFromScript instance to python. How I can somwhow convert it to TPyEventFromScript?
e.g. on delphiI have TQueue<TEventFromScript > and on python side I have a function who returns dequeued TEventFromScript, I need tell to python that it now responsible for returned object...
convert TEventFromScript to TPyEventFromScript and forget.