@encukou has done great work getting us to document newly added C API in recent versions (#135755, #118915), but unfortunately, we still have plenty of undocumented APIs. I'd like to begin working towards a future where the C API documentation is extensive, up-to-date, and most importantly, helpful to users.
Here's my plan:
- Document all remaining C APIs (macros, static inline functions, and exported symbols) that are prefixed with Py.
- Add a CI job that prevents new C APIs from being added to public headers without documentation.
- Improve our "Extending and Embedding" tutorial. I started on this a little while ago, but I think it would be better to get the full C API documented before we do that.
I'm going to work on this myself, but others are welcome to send PRs where necessary. I've applied the easy label to this for any newcomers who are interested in helping.
Below is a list of CPython's undocumented C API. I'm sure many of these aren't documented intentionally, so we should either deprecate them or keep a canonical list of "public but undocumented" somewhere.
bltinmodule.h
enumobject.h
bytearrayobject.h
bytesobject.h
codecs.h
compile.h
datetime.h
These are under #83785.
descrobject.h
dictobject.h
- PyDictItems_Check (gh-141004: Document C APIs for dictionary keys, values, and items #141009)
- PyDictItems_Type (gh-141004: Document C APIs for dictionary keys, values, and items #141009)
- PyDictKeys_Check (gh-141004: Document C APIs for dictionary keys, values, and items #141009)
- PyDictKeys_Type (gh-141004: Document C APIs for dictionary keys, values, and items #141009)
- PyDictValues_Check (gh-141004: Document C APIs for dictionary keys, values, and items #141009)
- PyDictValues_Type (gh-141004: Document C APIs for dictionary keys, values, and items #141009)
- PyDictViewSet_Check (gh-141004: Document C APIs for dictionary keys, values, and items #141009)
- PyDictIterItem_Type (gh-141004: Document remaining iterator types #141010)
- PyDictIterKey_Type (gh-141004: Document remaining iterator types #141010)
- PyDictIterValue_Type (gh-141004: Document remaining iterator types #141010)
- PyDictRevIterItem_Type (gh-141004: Document remaining iterator types #141010)
- PyDictRevIterKey_Type (gh-141004: Document remaining iterator types #141010)
- PyDictRevIterValue_Type (gh-141004: Document remaining iterator types #141010)
fileobject.h
listobject.h
memoryobject.h
objimpl.h
(All covered by #141146)
- PyObject_DEL
- PyObject_FREE
- PyObject_INIT_VAR
- PyObject_INIT
- PyObject_MALLOC
- PyObject_NEW_VAR
- PyObject_NEW
- PyObject_REALLOC
pybuffer.h
pycapsule.h
pydtrace.h
pyerrors.h
pyhash.h
(covered in #141205 and #141233)
pystrtod.h
rangeobject.h
setobject.h
traceback.h
tupleobject.h
exports.h
- PyAPI_DATA (gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) #143508)
- PyMODEXPORT_FUNC (PEP-793: gh-140550: PEP 793 reference documentation #141197)
- Py_EXPORTED_SYMBOL (gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) #143508)
- Py_IMPORTED_SYMBOL (gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) #143508)
- Py_LOCAL_SYMBOL (gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) #143508)
- PyAPI_FUNC (gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) #143508)
floatobject.h
longobject.h
methodobject.h
modsupport.h
moduleobject.h
py_curses.h
(covered by #141254)
- PyCursesInitialisedColor
- PyCursesInitialised
- PyCursesSetupTermCalled
- PyCursesWindow_Check
- PyCursesWindow_Type
- PyCurses_API_pointers
- PyCurses_CAPSULE_NAME
pymacro.h
pymath.h
typeslots.h
(Covered in #138190)
unicodeobject.h
object.h
pyexpat.h
(covered in #141259)
- PyExpat_CAPI_MAGIC
- PyExpat_CAPSULE_NAME
pyport.h
weakrefobject.h
cpython/pyctype.h
cpython/compile.h
cpython/descrobject.h
cpython/fileobject.h
cpython/methodobject.h
cpython/odictobject.h
(All covered by #141136)
- PyODictItems_Type
- PyODictIter_Type
- PyODictKeys_Type
- PyODictValues_Type
- PyODict_CheckExact
- PyODict_Check
- PyODict_Contains
- PyODict_DelItem
- PyODict_GetItemString
- PyODict_GetItemWithError
- PyODict_GetItem
- PyODict_New
- PyODict_SIZE
- PyODict_SetItem
- PyODict_Size
- PyODict_Type
cpython/picklebufobject.h
cpython/setobject.h
cpython/dictobject.h
cpython/genobject.h
cpython/import.h
cpython/longintrepr.h
cpython/pyerrors.h
cpython/pyframe.h
cpython/funcobject.h
cpython/unicodeobject.h
pystrcmp.h
intrcheck.h
ceval.h
pythread.h
cpython/frameobject.h
cpython/objimpl.h
cpython/pythonrun.h
cpython/ceval.h
cpython/pylifecycle.h
cpython/warnings.h
cpython/code.h
cpython/object.h
pymem.h
pystrtod.h
(all in #143867)
- Py_DTSF_ADD_DOT_0
- Py_DTSF_ALT
- Py_DTSF_NO_NEG_0
- Py_DTSF_SIGN
- Py_DTST_FINITE
- Py_DTST_INFINITE
- Py_DTST_NAN
structmember.h
object.h
Linked PRs
- gh-141004: Document missing built-in iterator types in the C API #141006
- gh-141004: Document C APIs for dictionary keys, values, and items #141009
- gh-141004: Document remaining iterator types #141010
- gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions #141019
- [3.13] gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions (GH-141019) #141026
- [3.14] gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions (GH-141019) #141027
- gh-141004: Document PyLong_FromPid and PyLong_AsPid #141028
- gh-141004: Document Py_RETURN_NAN and Py_RETURN_INF #141029
- gh-141004: soft-deprecate Py_INFINITY macro #141033
- gh-141004: Document PyMemoryView_Type #141034
- gh-141004: deprecate Py_MATH_El and Py_MATH_PIl macros #141035
- [3.14] gh-141004: Document missing iterator types in the C API (GH-141010) #141046
- [3.13] gh-141004: Document missing iterator types in the C API (GH-141010) #141047
- [3.14] gh-141004: Document PyMemoryView_Type (GH-141034) #141054
- [3.13] gh-141004: Document PyMemoryView_Type (GH-141034) #141055
- gh-141004: Document Py_hexdigits #141059
- [3.14] gh-141004: Document Py_RETURN_NAN and Py_RETURN_INF (GH-141029) #141074
- [3.13] gh-141004: Document Py_RETURN_NAN and Py_RETURN_INF (GH-141029) #141075
- gh-141004: Document PyDict_GET_SIZE #141078
- gh-141004: Document PyCapsule_Type #141079
- [3.14] gh-141004: Document PyDict_GET_SIZE (GH-141078) #141082
- [3.13] gh-141004: Document PyDict_GET_SIZE (GH-141078) #141083
- [3.14] gh-141004: Document built-in iterator types in the C API (GH-141006) #141134
- [3.13] gh-141004: Document built-in iterator types in the C API (GH-141006) #141135
- gh-141004: Document PyODict* APIs #141136
- gh-141004: Document Py_MakePendingCalls #141137
- [3.14] gh-141004: Document Py_hexdigits (GH-141059) #141138
- [3.13] gh-141004: Document Py_hexdigits (GH-141059) #141139
- [3.14] gh-141004: Document PyLong_FromPid and PyLong_AsPid (GH-141028) #141142
- [3.13] gh-141004: Document PyLong_FromPid and PyLong_AsPid (GH-141028) #141143
- gh-141004: document Py_INFINITY and Py_NAN macros #141145
- gh-141004: Document deprecated aliases for memory allocation #141146
- gh-141004: Document Py_GetRecursionLimit and Py_SetRecursionLimit #141151
- [3.14] gh-141004: Document Py_GetRecursionLimit and Py_SetRecursionLimit (GH-141151) #141156
- [3.13] gh-141004: Document Py_GetRecursionLimit and Py_SetRecursionLimit (GH-141151) #141157
- gh-141004: Document PyErr_WarnExplicitFormat #141187
- gh-141004: Document missing frame APIs #141189
- gh-141004: Document PyTraceBack* APIs #141192
- [3.13] gh-141004: Document PyCapsule_Type (GH-141079) #141198
- [3.14] gh-141004: Document PyCapsule_Type (GH-141079) #141199
- [3.14] gh-141004: Document PyErr_WarnExplicitFormat (GH-141187) #141202
- [3.13] gh-141004: Document PyErr_WarnExplicitFormat (GH-141187) #141203
- gh-141004: Document Py_HASH_* macros #141205
- [3.14] gh-141004: Document PyTraceBack* APIs (GH-141192) #141210
- [3.13] gh-141004: Document PyTraceBack* APIs (GH-141192) #141211
- gh-141004: fix versionadded typo for Py_HASH_SIPHASH13 #141223
- [3.13] gh-141004: Document Py_HASH_* macros (GH-141205) #141224
- [3.14] gh-141004: Document Py_HASH_* macros (GH-141205) #141225
- gh-141004: correctly document Py_HASH_* and PyHASH_* as hash_info attributes #141233
- [3.14] gh-141004: correctly document Py_HASH_* and PyHASH_* as hash_info attributes (GH-141233) #141234
- [3.13] gh-141004: correctly document Py_HASH_* and PyHASH_* as hash_info attributes (GH-141233) #141235
- gh-141004: Document PyErr_ProgramTextObject and PyErr_ProgramText #141250
- gh-141004: Document missing PyCFunction* and PyCMethod* APIs #141253
- gh-141004: document curses C API #141254
- gh-141004: Document PyBUF_WRITEABLE #141255
- [3.14] gh-141004: Document PyErr_ProgramTextObject and PyErr_ProgramText (GH-141250) #141256
- [3.13] gh-141004: Document PyErr_ProgramTextObject and PyErr_ProgramText (GH-141250) #141257
- gh-141004: document pyexpat C API #141259
- [3.13] gh-141004: Document PyBUF_WRITEABLE (GH-141255) #141260
- [3.14] gh-141004: Document PyBUF_WRITEABLE (GH-141255) #141261
- gh-141004: Document the PyDoc_VAR macro #141263
- [3.14] gh-141004: Document the PyDoc_VAR macro (GH-141263) #141264
- [3.13] gh-141004: Document the PyDoc_VAR macro (GH-141263) #141265
- gh-141004: Document Py_BUILD_ASSERT* macros #141266
- [3.14] gh-141004: Document Py_BUILD_ASSERT* macros (GH-141266) #141269
- [3.13] gh-141004: Document Py_BUILD_ASSERT* macros (GH-141266) #141270
- gh-141004: Document pyctype.h macros #141272
- gh-141004: Document Py_func_type_input #141273
- gh-141004: Document PyWeakref_CheckRefExact #141279
- [3.14] gh-141004: Document deprecated aliases for memory allocation (GH-141146) #141288
- [3.13] gh-141004: Document deprecated aliases for memory allocation (GH-141146) #141289
- [3.14] gh-141004: Document PyWeakref_CheckRefExact (GH-141279) #141290
- [3.14] gh-141004: document curses C API (GH-141254) #141292
- [3.13] gh-141004: document curses C API (GH-141254) #141293
- gh-141004: Document PyFunction_SetKwDefaults #141294
- gh-141004: Document PyClassMethod* and PyStaticMethod* APIs #141296
- [3.14] gh-141004: Document Py_func_type_input (GH-141273) #141298
- [3.13] gh-141004: Document Py_func_type_input (GH-141273) #141299
- gh-141004: Document PyExceptionInstance* APIs #141301
- [3.14] gh-141004: Document PyExceptionInstance* APIs (GH-141301) #141302
- [3.13] gh-141004: Document PyExceptionInstance* APIs (GH-141301) #141303
- [3.14] gh-141004: Document PyFunction_SetKwDefaults (GH-141294) #141304
- [3.13] gh-141004: Document PyFunction_SetKwDefaults (GH-141294) #141305
- [3.14] gh-141004: Document PyClassMethod* and PyStaticMethod* APIs (GH-141296) #141308
- [3.13] gh-141004: Document PyClassMethod* and PyStaticMethod* APIs (GH-141296) #141309
- gh-141004: Document Py_DTSF_* macros #141310
- gh-141004: Document PyType_FastSubclass #141313
- gh-141004: Document PySuper_Type #141315
- [3.14] gh-141004: Document PySuper_Type (GH-141315) #141318
- [3.13] gh-141004: Document PySuper_Type (GH-141315) #141319
- [3.14] gh-141004: Document Py_DTSF_* macros (GH-141310) #141329
- [3.13] gh-141004: Document Py_DTSF_* macros (GH-141310) #141330
- [3.13] gh-141004: Document pyctype.h macros (GH-141272) #141339
- [3.14] gh-141004: Document pyctype.h macros (GH-141272) #141340
- [3.14] gh-141004: Document PyType_FastSubclass (GH-141313) #141368
- [3.13] gh-141004: Document PyType_FastSubclass (GH-141313) #141369
- gh-141004: Document PyCode_Optimize #141378
- [3.14] gh-141004: Document missing frame APIs (GH-141189) #141379
- [3.13] gh-141004: Document missing frame APIs (GH-141189) #141380
- [3.14] gh-141004: document Py_INFINITY and Py_NAN macros (GH-141145) #141399
- [3.13] gh-141004: document Py_INFINITY and Py_NAN macros (GH-141145) #141400
- gh-141004: Document PyRun_InteractiveOneObject #141405
- gh-141004: Document PyBytes_Repr and PyBytes_DecodeEscape #141407
- gh-141004: Document PyType_SUPPORTS_WEAKREFS #141408
- gh-141004: Document missing generator APIs #141409
- gh-141004: Document PyFile_OpenCode and PyFile_OpenCodeObject #141413
- gh-141004: Document PyType_Unwatch #141414
- [3.14] gh-141004: Document PyType_Unwatch (GH-141414) #141418
- [3.13] gh-141004: Document PyType_Unwatch (GH-141414) #141419
- gh-141004: Document Py_MATH_{E, PI, TAU} constants #141373
- [3.14] gh-141004: Document PyFile_OpenCode and PyFile_OpenCodeObject (GH-141413) #141425
- [3.13] gh-141004: Document PyFile_OpenCode and PyFile_OpenCodeObject (GH-141413) #141426
- [3.14] gh-141004: Document PyBytes_Repr and PyBytes_DecodeEscape (GH-141407) #141440
- [3.13] gh-141004: Document PyBytes_Repr and PyBytes_DecodeEscape (GH-141407) #141441
- [3.14] gh-141004: Document PyType_SUPPORTS_WEAKREFS (GH-141408) #141470
- [3.14] gh-141004: Document Py_MATH_{E, PI, TAU} constants (GH-141373) #141471
- [3.13] gh-141004: Document Py_MATH_{E, PI, TAU} constants (GH-141373) #141472
- [3.14] gh-141004: Document PyRun_InteractiveOneObject (GH-141405) #141485
- [3.13] gh-141004: Document PyRun_InteractiveOneObject (GH-141405) #141486
- [3.13] gh-141004: Document PyType_SUPPORTS_WEAKREFS (GH-141408) #141487
- [3.14] gh-141004: Document C APIs for dictionary keys, values, and items (GH-141009) #141512
- [3.13] gh-141004: Document C APIs for dictionary keys, values, and items (GH-141009) #141513
- [3.14] gh-141004: Document PyCode_Optimize (GH-141378) #141514
- [3.13] gh-141004: Document PyCode_Optimize (GH-141378) #141515
- gh-141004: Document PyException_HEAD #141522
- [3.13] gh-141004: Document PyErr_RangedSyntaxLocationObject (GH-141521) #141524
- [3.14] gh-141004: Document PyErr_RangedSyntaxLocationObject (GH-141521) #141525
- gh-141004: Document PyOS_InterruptOccurred #141526
- gh-141004: Document missing PyDateTime* APIs. #141543
- gh-141004: document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN #141544
- [3.14] gh-141004: Document PyOS_InterruptOccurred (GH-141526) #141549
- [3.13] gh-141004: Document PyOS_InterruptOccurred (GH-141526) #141550
- gh-141004: Document Py_ARRAY_LENGTH macro #141598
- gh-141004: Document Py_ARRAY_LENGTH macro #141601
- gh-141004: Document the PyPickleBuffer_* C API #141630
- [3.14] gh-141004: Document the PyPickleBuffer_* C API (GH-141630) #141632
- [3.13] gh-141004: Document the PyPickleBuffer_* C API (GH-141630) #141633
- gh-141004: Document soft-deprecated symbols #141634
- [3.14] gh-141004: Document missing PyCFunction* and PyCMethod* APIs (GH-141253) #141637
- [3.13] gh-141004: Document missing PyCFunction* and PyCMethod* APIs (GH-141253) #141638
- [3.14] gh-141004: Document PyODict* APIs (GH-141136) #141677
- [3.13] gh-141004: Document PyODict* APIs (GH-141136) #141678
- [3.14] gh-141004: Document Py_MEMCPY (GH-141676) #141685
- [3.14] gh-141004: Document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN (GH-141544) #141698
- [3.13] gh-141004: Document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN (GH-141544) #141700
- gh-141004: Document Py_LOCAL* #141725
- gh-141004: Document PyOS_mystr(n)icmp #141760
- [3.14] gh-141004: Document Py_LOCAL and Py_LOCAL_INLINE (GH-141725) #141761
- [3.13] gh-141004: Document Py_LOCAL and Py_LOCAL_INLINE (GH-141725) #141762
- [3.14] gh-141004: Document Py_MakePendingCalls (GH-141137) #141787
- [3.13] gh-141004: Document Py_MakePendingCalls (GH-141137) #141788
- [3.14] gh-141004: Document missing generator APIs (GH-141409) #141789
- [3.13] gh-141004: Document missing generator APIs (GH-141409) #141790
- [3.14] gh-141004: Document missing PyDateTime* APIs (GH-141543) #141791
- [3.13] gh-141004: Document missing PyDateTime* APIs (GH-141543) #141792
- gh-141004: Document descriptor and dict proxy type objects #141803
- gh-141004: Document missing PyThread* APIs #141810
- gh-141004: Document stack effect APIs #141843
- gh-141004: Document PyImport_Inittab #141844
- gh-141004: Document PyDTrace* #141856
- [3.14] gh-141004: Document Py_ARRAY_LENGTH (GH-141601) #141895
- [3.13] gh-141004: Document Py_ARRAY_LENGTH (GH-141601) #141896
- [3.14] gh-141004: Document PyImport_Inittab (GH-141844) #141915
- [3.14] gh-141004: Document stack effect C APIs (GH-141843) #141916
- [3.13] gh-141004: Document stack effect C APIs (GH-141843) #141917
- [3.14] gh-141004: Document PyOS_mystr(n)icmp (GH-141760) #141947
- [3.13] gh-141004: Document PyOS_mystr(n)icmp (GH-141760) #141948
- [3.14] gh-141004: Document missing PyThread* APIs (GH-141810) #141954
- [3.13] gh-141004: Document missing PyThread* APIs (GH-141810) #141955
- [3.13] gh-141004: Document PyImport_Inittab (GH-141844) #142016
- gh-141004: Add a CI job ensuring that new C APIs include documentation #142102
- [3.14] gh-141004: Document descriptor and dict proxy type objects (GH-141803) #142147
- [3.13] gh-141004: Document descriptor and dict proxy type objects (GH-141803) #142148
- [3.14] gh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102) #142247
- [3.13] gh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102) #142248
- gh-141004: Document unstable executable kind macros in pyframe.h #143490
- gh-141004: Document unstable perf map functions in ceval.h #143492
- gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros #143494
- gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) #143508
- gh-141004: Improve make check-c-api-docs #143564
- gh-141004: Document old provisional names for vectorcall/code API #143568
- gh-141004: GHA: Run check-c-api-docs check on docs-only PRs #143573
- gh-141004: Don't trigger run-tests when Tools/check-c-api-docs/ignored_c_api.txt is changed #143583
- [3.14] gh-141004: Improve make check-c-api-docs (GH-143564) #143593
- [3.13] gh-141004: Improve make check-c-api-docs (GH-143564) #143594
- gh-141004: Document remaining constants from patchlevel.h #143598
- gh-141004: Mark up docs of old PyMem macros #143783
- [3.14] gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH-143494) #143785
- [3.14] gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508) #143786
- [3.13] gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508) #143787
- [3.14] gh-141004: Don't trigger run-tests when Tools/check-c-api-docs/ignored_c_api.txt is changed (GH-143583) #143793
- [3.13] gh-141004: Don't trigger run-tests when Tools/check-c-api-docs/ignored_c_api.txt is changed (GH-143583) #143794
- [3.14] gh-141004: Document old provisional names for vectorcall/code API (GH-143568) #143828
- [3.13] gh-141004: Document old provisional names for vectorcall/code API (GH-143568) #143829
- [3.14] gh-141004: Document several soft-deprecated C APIs (GH-141634) #143837
- [3.14] gh-141004: Mark up docs of old PyMem macros (GH-143783) #143864
- [3.13] gh-141004: Mark up docs of old PyMem macros (GH-143783) #143865
- gh-141004: Mark up constants for PyOS_double_to_string #143867
- gh-141004: Document PyException_HEAD and PyDescr_COMMON #143896
- [3.14] gh-141004: Mark up constants for PyOS_double_to_string (GH-143867) #144146
- [3.13] gh-141004: Mark up constants for PyOS_double_to_string (GH-143867) #144147
- gh-141004: Document remaining pyport.h utility macros #144279
- gh-141004: Reorganize and reword the 'Useful macros' section #144471
- [3.14] gh-141004: Document remaining pyport.h utility macros (GH-144279) #144477
- [3.13] gh-141004: Document remaining pyport.h utility macros (GH-144279) #144478
- [3.14] gh-141004: Reorganize and reword the 'Useful macros' section (GH-144471) #144541
- gh-141004: Document PyModuleDef_Type #145043
- gh-141004: Document missing type flags #145127
- [3.14] gh-141004: Document PyModuleDef_Type (GH-145043) #145146
- [3.13] gh-141004: Document PyModuleDef_Type (GH-145043) #145147
- [3.14] gh-141004: Document missing type flags (GH-145127) #145316
- [3.13] gh-141004: Document missing type flags (GH-145127) #145317
- [3.13] gh-141004: Document PyDTrace* (GH-141856) #145958
- [3.14] gh-141004: Document PyDTrace* (GH-141856) #145959
- [3.15] gh-141004: Document unstable perf map functions in ceval.h (GH-143492) #150849
- gh-141004: Document remaining PyCF compiler flag macros #153958
- [3.15] gh-141004: Document remaining PyCF_* compiler flag macros (GH-153958) #153984
- [3.14] gh-141004: Document remaining PyCF_* compiler flag macros (GH-153958) #153985
- [3.13] gh-141004: Document remaining PyCF_* compiler flag macros (GH-153958) #153986
- [3.15] gh-141004: Document unstable executable kind macros from pyframe.h (GH-143490) #153988
- [3.14] gh-141004: Document unstable executable kind macros from pyframe.h (GH-143490) #153991
- [3.13] gh-141004: Document unstable executable kind macros from pyframe.h (GH-143490) #153993
- [3.14] gh-141004: Document unstable perf map functions in ceval.h (GH-143492) #153994
- [3.13] gh-141004: Document unstable perf map functions in ceval.h (GH-143492) #153996
- [3.14] gh-141004: GHA: Run check-c-api-docs check on docs-only PRs (GH-143573) #154464
- [3.13] gh-141004: GHA: Run check-c-api-docs check on docs-only PRs (GH-143573) (GH-154464) #154640
Reactions are currently unavailable
@encukou has done great work getting us to document newly added C API in recent versions (#135755, #118915), but unfortunately, we still have plenty of undocumented APIs. I'd like to begin working towards a future where the C API documentation is extensive, up-to-date, and most importantly, helpful to users.
Here's my plan:
I'm going to work on this myself, but others are welcome to send PRs where necessary. I've applied the easy label to this for any newcomers who are interested in helping.
Below is a list of CPython's undocumented C API. I'm sure many of these aren't documented intentionally, so we should either deprecate them or keep a canonical list of "public but undocumented" somewhere.
bltinmodule.h
enumobject.h
bytearrayobject.h
bytesobject.h
codecs.h
compile.h
datetime.h
These are under #83785.
descrobject.h
dictobject.h
fileobject.h
listobject.h
memoryobject.h
objimpl.h
(All covered by #141146)
pybuffer.h
pycapsule.h
pydtrace.h
pyerrors.h
pyhash.h
(covered in #141205 and #141233)
pystrtod.h
rangeobject.h
setobject.h
traceback.h
tupleobject.h
exports.h
floatobject.h
longobject.h
methodobject.h
modsupport.h
moduleobject.h
py_curses.h
(covered by #141254)
pymacro.h
pymath.h
typeslots.h
(Covered in #138190)
unicodeobject.h
object.h
pyexpat.h
(covered in #141259)
pyport.h
weakrefobject.h
cpython/pyctype.h
cpython/compile.h
cpython/descrobject.h
cpython/fileobject.h
cpython/methodobject.h
cpython/odictobject.h
(All covered by #141136)
cpython/picklebufobject.h
cpython/setobject.h
cpython/dictobject.h
cpython/genobject.h
cpython/import.h
cpython/longintrepr.h
cpython/pyerrors.h
cpython/pyframe.h
cpython/funcobject.h
cpython/unicodeobject.h
pystrcmp.h
intrcheck.h
ceval.h
pythread.h
cpython/frameobject.h
cpython/objimpl.h
cpython/pythonrun.h
cpython/ceval.h
cpython/pylifecycle.h
cpython/warnings.h
cpython/code.h
cpython/object.h
pymem.h
pystrtod.h
(all in #143867)
structmember.h
object.h
Linked PRs