Means to expose attributes and members of built-in types#210
Means to expose attributes and members of built-in types#210jeff5 merged 6 commits intojython:mainfrom
Conversation
We define exposure for members of built-in types by addition of the mechanisms to TypeExposer. There is a fairly thorough test.
We define exposure for attributes (with implementor-defined protocols) of built-in types by addition of the mechanisms to TypeExposer. There is a fairly thorough test.
We beef up a test of the mechanism for exposing types. Also, use the annotations in a few places. (Many others potentially.)
|
@jeff5 This looks great! Also (I know you've been doing this all along but) I want to say that I especially love how you put in comments like "Compare CPython descr_setcheck in descrobject.c" <- these pointers will be invaluable to future contributors. |
|
I think there is some more to do here to get the annotations working as desired. In particular we ought to be able to inherit down the Java line (as well as Python inheritance through the |
Previously, the TypeExposer would miss Member annotations added to fields in the super-class of an exposed type. We demonstrate success in an improved test. A real example is the __name__ attribute of descriptor objects which we like to inherit from Descriptor.
In particular, we test that get-set attribute definitions can be Java-inherited.
Merging from main to fix Python version
|
Although I usually leave these a few weeks after the final change, the bulk of this has had that chance so will merge shortly. |
Another chunk of the exposure mechanism, following up from #205 and only slightly less of a leap. (#205 stopped at methods.)
@fwierzbicki : pinging you again for your interest.