Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork320
The python wrappers now reflect the Delphi inheritance hierarchy#399
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
With the fix to#382, tp_base is correctly set for wrappers descending from TPyDelphiObject and registered through the standard RegisterDelphiWrapper mechanism. This means that the isinstance and issubclass builtins will work correctly on wrapped Delphi objects and classes. It also means that we should not call inherited in RegisterMethods and RegisterGetSets, since python will find the inherited methods and getsets anyway. Calling inherited does not do any harm (it overrides the methods in inherited classes), but it is inefficient speed and memory-wise. Wrapped classes which do not provide a RegisterMethods and RegisterGetSets override, they should provide an empty one. Otherwise the inherited ones would be created on both the parent and the child class leading to unnecessary duplication. 45ca26c removed the calls to inherited from existing implementations of RegisterMethods and RegisterGetSets. It also changed the implementation of the |
BetaWas this translation helpful?Give feedback.
All reactions
👍 2
Replies: 1 comment 7 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
We have this fixed and many other enhancements in the latest "docs" feature branch. Have a look:https://github.com/Embarcadero/python4delphi/tree/docs
|
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Class methods static or otherwise have been supported for a long time. See for instancehttps://github.com/pyscripter/python4delphi/blob/master/Tutorials/Webinar%20I/WrapDelphiDemo/MainForm.pas#L49 What is not supported is class fields and properties, but AFAIK (seehttps://en.delphipraxis.net/topic/8087-access-class-fields-and-properties-with-rtti/) this is not currently possible. @lmbelo Could you please clarify what is the new functionality in that respect and how it was implemented. |
BetaWas this translation helpful?Give feedback.
All reactions
-
When referred from a given instance of a type, not the type itself, right? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Yes. I see. Now you can call class methods from the type? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Yes, exactly. Class and static methods from a type. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Good! |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1