-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable creating subclasses of com_record #2361
Comments
I suspect this was done for 20 year old reasons that no longer apply. I see no problem with allowing subclasses here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be desirable to create subclasses of
com_record
to enable typing of interface methods that expect a particular structure as a parameter.I've just started to look into writing C/C++ Python extensions and therefore probably do not understand what problems it would create when the
PyRecord::Type
structure would be modified to allow this.Wouldn't it be just sufficient to set the field:
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags
and to define a function for the
tp_new
field in thePyRecord::Type
structure?This function could make use of the
PyRecord::pythoncom_GetRecordFromGuids
function to create the new instance.I'm wondering what the reason was, to just allow the creation of
com_record
instances via the factory functionwin32com.client.Record
and not allow the creation of subclasses. Would this open a Pandora's box of issues that I probably do not see?The text was updated successfully, but these errors were encountered: