GH-92678: Document that you shouldn't be doing your own dictionary offset calculations. (GH-95598)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
This commit is contained in:
Mark Shannon 2022-08-09 14:26:37 +01:00 committed by GitHub
parent eb81c1aea1
commit 8d37c62c2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 13 deletions

View file

@ -1079,7 +1079,11 @@ _PyObject_ComputedDictPointer(PyObject *obj)
/* Helper to get a pointer to an object's __dict__ slot, if any.
* Creates the dict from inline attributes if necessary.
* Does not set an exception. */
* Does not set an exception.
*
* Note that the tp_dictoffset docs used to recommend this function,
* so it should be treated as part of the public API.
*/
PyObject **
_PyObject_GetDictPtr(PyObject *obj)
{