gh-127443: Add semantics for stolen references in Doc/data/refcounts.dat#127468
gh-127443: Add semantics for stolen references in Doc/data/refcounts.dat#127468picnixz wants to merge 7 commits intopython:mainfrom
Doc/data/refcounts.dat#127468Conversation
|
Some functions that steal references but are not yet included/fixed (waiting for other PRs):
|
ZeroIntensity
left a comment
There was a problem hiding this comment.
I will say, there are some functions that do truly steal a reference by DECREFing the input. For example, PyModule_AddObject--do we want to treat that with $, or with -1?
|
If they |
|
I'll let you decide :) |
On success, However, on error it does not steal a reference -- it does failed |
|
Would it make sense to prefix existing comments with |
|
After a discussion with Petr, I think it would better not to introduce new semantics for now. The idea is to make the last field hold some special attributes. Those attributes would indicate So I'll close this one but will definitely re-use the data from here. Note: I could limit myself to modifying the 5th field, but until I've written the tool and the correct syntax I expect, I prefer minimizing the commits. |
For now, it only changes the entry that are know to be stealing references. I'd like to have some help here: if you know which functions steals references, just drop the name and I'll update the PR (it's hard for me to find them automatically...).
This PR should be merged after #127451 and probably before #127443 so that I can use the new symbol and don't need to update the comment.
Doc/data/refcounts.dat#127443📚 Documentation preview 📚: https://cpython-previews--127468.org.readthedocs.build/