[Python-Dev] Re: Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-01-12 Thread encukou
Simon Cross wrote:
> We've run into some minor issues with the limitations in PyType_Slot
> (https://docs.python.org/3/c-api/type.html#c.PyType_Slot.PyType_Slot.slot)
> but we are working around them for the moment.
> It would be useful to have some sense of where PyType_FromSpec is
> headed -- e.g. is it a goal to have it support all of the features of
> static types in the future -- so that we can perhaps help suggest /
> implement small changes that head in the right direction and also
> ensure that HPy is aligned with the immediate future of the C API.

Yes, the goal is to have it support all the features of static types.
If you see something that's not in PEP 630 open issues 
(https://www.python.org/dev/peps/pep-0630/#open-issues),
I'd like to know.
I'm using https://github.com/encukou/abi3/issues to collect issues related to 
the stable ABI. Maybe have some of HPy's issues there already.

And fixes are always welcome, of course :)
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/BFLYTI2WZZY5W3LKF5WBT4MZBTB6O7N6/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Static inline functions in header files, limited API and the stable ABI

2020-01-30 Thread encukou
Victor Stinner wrote:
> Hi,
> Is it ok to add a static inline function to the limited API? Can it
> cause ABI issue? Or is it safer to add a regular function? For
> example, is it safe to add the following function to the limited API?
> static inline PyObject 
> _PyObject_CallOneArg(PyObject func, PyObject *arg)
> {
> ...
> return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL);
> }
> Or should it be an opaque definition like the following function?
> PyAPI_FUNC(PyObject ) PyObject_CallNoArgs(PyObject func);

Yes, it should need the opaque definition. Otherwise we'd need to ensure
ABI compatibility for _PyObject_VectorcallTstate and we would need to
support the exact definition of the static inline function "forever".

> I came to this question while reviewing "Make Vectorcall public" C API:
> https://bugs.python.org/issue39245
> https://github.com/python/cpython/pull/17893

Just to clarify, that PR does not propose adding things to the limited API.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/O4NI45WC64EBET65AN6FZIRBYIRRKAHD/
Code of Conduct: http://python.org/psf/codeofconduct/