Meeting November 16 (Monday) at 10:00 UTC
Hi,
I would like to discuss evolutions of the C API in CPython. I propose to meet next monday (November 16) at 10:00 on Zoom:
Zoom URL: https://oracle.zoom.us/j/339127822?pwd=YkNZbFgvdXZ4Z3NlcWg1N3BlZ3JTUT09 Meeting ID: 339 127 822 Password: 237729
I'm trying to "bend" the C API towards HPy, but I'm facing different issues. Other CPython core devs basically suggest that I leave the C API as it is: "developers will continue to use the old C API since it's not going to move away anytime soon" :-(
In my latest attempt, I proposed to add new functions which only use regular strong refs, don't steal references and avoid borrowed references:
https://bugs.python.org/issue42294
For example, add PyTuple_GetItemRef() which returns a strong reference.
I also added "borrowed reference" and "strong reference" to the Python documentation glossary. I was surprised that there was no definition of that previously!
https://docs.python.org/dev/glossary.html#term-strong-reference
I also enhanced the Reference Counting documentation:
https://docs.python.org/dev/c-api/refcounting.html
See also:
- PEP 620 "Hide implementation details from the C API" which is related: https://www.python.org/dev/peps/pep-0620/
- My notes on "bad C API": https://pythoncapi.readthedocs.io/bad_api.html
See you monday!
Victor
Night gathers, and now my watch begins. It shall not end until my death.
On Thu, Nov 12, 2020 at 2:49 PM Victor Stinner <vstinner@python.org> wrote:
Hi,
I would like to discuss evolutions of the C API in CPython. I propose to meet next monday (November 16) at 10:00 on Zoom:
Just to stress it out: it's at 10:00 *UTC* (it's in the subject but not in the body, so I thought it was a good idea to specify :))
We had quite a fun meeting on Monday. One of the outcomes was a decision to write a sort of manifesto explaining what we believe needs to change and explaining why. The idea is that this can help us spread the word in a polished, well articulated form and avoid us having to try explain all our thinking to every person involved in Python or C extension development (which would take more lifetimes than we have to spare).
I'm working on the manifesto at https://github.com/hpyproject/hpy/wiki/c-api-next-level-manifesto.
Eventually this may move into the HPy documentation, but our intention during the meeting was to explain what we think needs to change, rather than to tie it to a particular solution (i.e. HPy) straight away.
Comments here or anywhere else welcome. I'd like to make this as good as we possibly can because the better it is, the more likely it will convince others / accurately convey our thinking.
Yours sincerely, Simon Cross
participants (3)
-
Antonio Cuni
-
Simon Cross
-
Victor Stinner