Skip to content
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

PPyDescrObject and descendants declarations are not aligned with Python 3.3+ #493

Closed
jokusoftware opened this issue Jan 7, 2025 · 2 comments
Labels

Comments

@jokusoftware
Copy link

Hello,
I have discovered that the declarations of PPyDescrObject and its descendants are not aligned with the current state of descrobject.h in Python 3.3+. The structure was extended in commit python/cpython@9d57481 . A patch is attached. I am also attaching a tiny patch to add PyGetSetDescr_Type declaration.

Best regards,
Joe

0001-reflect-PyDescr_COMMON-change-made-to-Python-3.3.patch
0001-add-PyGetSetDescr_Type.patch

@pyscripter
Copy link
Owner

pyscripter commented Jan 7, 2025

I have applied your patches. These structures are not used anywhere in the P4D code, so the discrepancy had no impact. I would be interested to know whether and how you are using them.

This help document explains how to use them from python code, but I am not sure how it relates to the C-API.

@jokusoftware
Copy link
Author

Thank you very much for applying the patches. The PPyDescrObject declarations are of limited use. I am trying to use them from C-API to enum class elements. PyObject_GetAttr() invoked for a class do return these instances and for a GetSet property it is a PPyGetSetDescrObject instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants