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

No mention of Py_FindMethod getattr/setattr for Python extensions #24

Open
ericzolf opened this issue Apr 6, 2019 · 1 comment
Open

Comments

@ericzolf
Copy link

ericzolf commented Apr 6, 2019

Your book, especially http://python3porting.com/cextensions.html, has already been very helpful to start porting rdiff-backup to Python3, but I'm stuck on the disappearance of Py_FindMethod as used in rdiff_backup/_librsyncmodule.c. According to my research:

  1. the Python documentation isn't too explicit about what this function was used for (no examples)
  2. the subtle difference between tp_getattr/tp_settatr and tp_getattro/tp_setattro could be clearer (beside the fact that the first ones are outdated).
  3. there are two cases: you can use the PyObject_GenericG/SetAttr or not, but the criteria for this decision are unclear to me.
  4. If you can use the Generic functions, you don't need Py_FindMethod so that's easy, but there are no explanations if you can't (which seems to be my specific case) on how to get rid of the method without breaking your code.

So quite a lot of missing explanations, I think, which you could possibly highlight in an update.

@regebro
Copy link
Owner

regebro commented Apr 8, 2019

There are indeed many obscure differences, especially in C-extensions, and there exists no exhaustive list of what those differences are, so I have made no attempt of trying to cover all changes when it comes to the C API.

A list of common changes would be good, but honestly, for everything that isn't covered, I've only ever gotten one email issue per API call that changed, and only something like 3 or 4 issues/emails about the C API in total.

I'll keep the issue open, and Google searches should find it if anyone else uses this method.

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

No branches or pull requests

2 participants