Uh oh!
There was an error while loading. Please reload this page.
gh-139847: Add PyType_Lookup() function - #139848
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Sam Gross <colesbury@gmail.com>
vstinner
commented
Oct 9, 2025
The CI fails with:
I added the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Oct 11, 2025
I reverted changes to schedule |
vstinner
commented
Oct 14, 2025
@encukou: So what do you think of exposing this PyType function? |
encukou
commented
Oct 14, 2025
I think there's benefit to exposing this but we need to do it carefully. The operation is different from getattr in surprising ways. The docs & tests should mention details -- not invoking descriptors or metaclass getattr. It might also be good for the docs to add an example of where Python uses this operaton, and/or equivalent Python code. “Lookup” is a new term in the public C API; are we sure this is the right operation for the name? |
Add Python pseudo-code in the doc.
vstinner
commented
Oct 14, 2025
Good idea. I added tests for that and completed the doc.
I added Python pseudo-code to the doc. |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
vstinner
commented
Feb 10, 2026
The issue was closed, so I close the PR as well: #139847 (comment). |
📚 Documentation preview 📚: https://cpython-previews--139848.org.readthedocs.build/