Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Document the entire C API #141004

Open
0 of 2 issues completed
Open
0 of 2 issues completed
Assignees
Labels
3.13bugs and security fixes 3.14bugs and security fixes 3.15new features, bugs and security fixes docsDocumentation in the Doc dir topic-C-API
@ZeroIntensity

Description

@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:

  1. Document all remaining C APIs (macros, static inline functions, and exported symbols) that are prefixed with Py.
  2. Add a CI job that prevents new C APIs from being added to public headers without documentation.
  3. 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

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

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

  • PyDescr_COMMON
  • PyDescr_NAME
  • PyDescr_TYPE
  • PyWrapperFlag_KEYWORDS

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

  • PyUnstable_EXECUTABLE_KINDS
  • PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION
  • PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR
  • PyUnstable_EXECUTABLE_KIND_PY_FUNCTION
  • PyUnstable_EXECUTABLE_KIND_SKIP

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

  • PyUnstable_CopyPerfMapFile
  • PyUnstable_PerfTrampoline_CompileCode
  • PyUnstable_PerfTrampoline_SetPersistAfterFork

cpython/pylifecycle.h

  • Py_FrozenMain

cpython/warnings.h

cpython/code.h

cpython/object.h

pymem.h

pystrtod.h

(these need namespace:NULL)

  • 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

  • PY_AUDIT_READ

object.h

  • Py_TPFLAGS_HAVE_STACKLESS_EXTENSION

Linked PRs

Sub-issues

Metadata

Metadata

Labels

3.13bugs and security fixes 3.14bugs and security fixes 3.15new features, bugs and security fixes docsDocumentation in the Doc dir topic-C-API

Projects

Status

Todo

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /