Modernize macosx backend a bit#27874
Conversation
|
The use of |
a745703 to
4b00c34
Compare
|
Also, forgot to mention that I think |
greglucas
left a comment
There was a problem hiding this comment.
Python docs say it should be the fully qualified name including the package so I agree with that: https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_name
This looks good to me and the reordering makes sense.
A few other minor nit cleanups if you want to add them:
- The
mplutils.hinclude is no longer needed either I don't think. - We don't have any
s#variants, so I don't think we need the#define PY_SSIZE_T_CLEANeither.
Modify `PyTypeObject` definitions to match the 3.9 C-embedding tutorial. Use `PyDoc_STR` for possible optimization purposes. Re-order fields in a bit clearer manner (object information, new+init, dealloc, repr, methods). And finally, use the new `PyModule_AddType`, which does what our `prepare_and_add_type` inline function does.
4b00c34 to
bffdc18
Compare
I removed this one; it was no longer needed due to dropping
Yes, it's not needed, but I'd rather keep that one in case things change in the future. |
PR summary
Modify
PyTypeObjectdefinitions to match the 3.9 C-embedding tutorial. UsePyDoc_STRfor possible optimization purposes. Re-order fields in a bit clearer manner (object information, new+init, dealloc, repr, methods). And finally, use the newPyModule_AddType, which does what ourprepare_and_add_typeinline function does.PR checklist