The python wrappers now reflect the Delphi inheritance hierarchy #399
pyscripter
announced in
Announcements
Replies: 1 comment 7 replies
-
We have this fixed and many other enhancements in the latest "docs" feature branch. Have a look: https://github.com/Embarcadero/python4delphi/tree/docs
|
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
__dir__
wrapper. However, now, empty RegisterMethods and RegisterGetSets, should be added to the wrappers that do not have these methods.@lmbelo, @jimmckeeth
Beta Was this translation helpful? Give feedback.
All reactions