[issue47115] Documentation inconsistency with the stable ABI

2022-04-06 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset d79f118d044e9b4244b5dfda35448d39202d7f56 by Petr Viktorin in 
branch 'main':
bpo-47115: Document which parts of structs are in limited API/stable ABI 
(GH-32196)
https://github.com/python/cpython/commit/d79f118d044e9b4244b5dfda35448d39202d7f56


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47115] Documentation inconsistency with the stable ABI

2022-03-30 Thread Petr Viktorin


Change by Petr Viktorin :


--
keywords: +patch
pull_requests: +30272
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32196

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47115] Documentation inconsistency with the stable ABI

2022-03-30 Thread Petr Viktorin


Petr Viktorin  added the comment:

So. According to PEP 384 (which added all structs in the stable ABI, except 
Py_buffer), some structs are opaque and others have a few members exposed:
https://peps.python.org/pep-0384/#structures

I will split the latter into 1) structs that have a few fields exposed mainly 
for backwards compatibility (which, of course, is very important here). Best 
practice is to treat them as opaque (use getters/setters):

- PyObject (ob_refcnt, ob_type)
- PyVarObject (ob_base, ob_size)

... and 2) structs for which all fields are part of the ABI (and the struct's 
size as well: for most of these as users are expected to provide arrays):

- PyMethodDef
- PyMemberDef
- PyGetSetDef
- PyModuleDefBase
- PyModuleDef
- PyStructSequence_Field
- PyStructSequence_Desc
- PyType_Slot
- PyType_Spec
- Py_buffer (new in 3.11)

The opaque structs continue to be:

- PyThreadState
- PyInterpreterState
- PyFrameObject
- symtable
- PyWeakReference
- PyLongObject
- PyTypeObject

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47115] Documentation inconsistency with the stable ABI

2022-03-28 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thanks for the report! You're right that this is misleading. I'll clarify the 
docs for this and other structs.

- struct PyTypeObject is part if the limited API.
- its fields and size are not part of the API or stable ABI.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47115] Documentation inconsistency with the stable ABI

2022-03-25 Thread Ned Deily


Change by Ned Deily :


--
nosy: +petr.viktorin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47115] Documentation inconsistency with the stable ABI

2022-03-25 Thread Jeremiah Gabriel Pascual


New submission from Jeremiah Gabriel Pascual :

In https://docs.python.org/3/c-api/typeobj.html#static-types, it says that 
PyTypeObject isn't part of the stable ABI. Yet, in 
https://docs.python.org/3/c-api/type.html#c.PyTypeObject, it says that 
PyTypeObject IS part of the stable ABI. Which is true?

--
assignee: docs@python
components: Documentation
messages: 415989
nosy: Crowthebird, docs@python
priority: normal
severity: normal
status: open
title: Documentation inconsistency with the stable ABI

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com