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
gh-103092: Port some _ctypes
data types to heap types
#113630
base: main
Are you sure you want to change the base?
Conversation
@vstinner Could you review this behavior change? |
_ctypes
data types to heap types
This is an attempt without hacking type slots. Problem: It is possible that accessing metaclasses cause a crash with bad arguments (e.g. cc PEP 687 experts: @erlend-aasland @kumaraditya303 |
To make this easier to review -- and to make the issue easier to see for as many reviewers as possible, would you mind sending a PR that adds the IMO, the correct way with the current heap type creation API is to move the initialization to Another option is to improve the type creation API -- e.g. design a slot that works like |
I would prefer a smaller PR. You moved 7 types. Can you start with a PR which change less types and less files at once? |
@encukou Is it worth opening a new issue for that? Maybe a custom meta |
Oh, I think it's worth writing a PEP for that :) |
Sorry, I'm not qualified, as I'm volunteering anonymously. |
Currently,
PyType_From*
functions refuse or ignore creating classes whose metaclass overridestp_new
(#103968). The ctypes extension needs some workaround for that.