Skip to main content

Include/

The public C API. Include/*.h is what extension authors include via #include <Python.h>. Include/internal/ is the private API used by CPython itself.

For gopy these headers are the source of truth for struct layouts (PyObject, PyTypeObject, PyDictObject, ...) and slot tables (tp_*, nb_*, sq_*, mp_*, am_*). The gopy mirror types are laid out field-for-field where possible so that ported C functions translate mechanically.

Public headers (top level)

FileLinesPage
Include/abstract.h915annotated
Include/audit.h30(pending)
Include/bltinmodule.h14(pending)
Include/boolobject.h54(pending)
Include/bytearrayobject.h44(pending)
Include/bytesobject.h66(pending)
Include/ceval.h145(pending)
Include/codecs.h176(pending)
Include/compile.h22(pending)
Include/complexobject.h30(pending)
Include/critical_section.h16(pending)
Include/datetime.h267(pending)
Include/descrobject.h100(pending)
Include/dictobject.h108(pending)
Include/dynamic_annotations.h499(pending)
Include/enumobject.h17(pending)
Include/errcode.h45(pending)
Include/exports.h105(pending)
Include/fileobject.h41(pending)
Include/fileutils.h62(pending)
Include/floatobject.h54(pending)
Include/frameobject.h20(pending)
Include/genericaliasobject.h14(pending)
Include/import.h103(pending)
Include/intrcheck.h23(pending)
Include/iterobject.h24(pending)
Include/listobject.h55annotated
Include/lock.h16(pending)
Include/longobject.h178(pending)
Include/marshal.h31(pending)
Include/memoryobject.h34(pending)
Include/methodobject.h146(pending)
Include/modsupport.h146(pending)
Include/moduleobject.h122(pending)
Include/monitoring.h18(pending)
Include/object.h828(pending)
Include/objimpl.h211(pending)
Include/opcode_ids.h259(pending)
Include/opcode.h43(pending)
Include/osdefs.h57(pending)
Include/osmodule.h17(pending)
Include/patchlevel.h49(pending)
Include/py_curses.h117(pending)
Include/pyatomic.h16(pending)
Include/pybuffer.h145(pending)
Include/pycapsule.h58(pending)
Include/pydtrace.h59(pending)
Include/pyerrors.h335(pending)
Include/pyexpat.h62(pending)
Include/pyframe.h26(pending)
Include/pyhash.h59(pending)
Include/pylifecycle.h80(pending)
Include/pymacconfig.h91(pending)
Include/pymacro.h249(pending)
Include/pymath.h65(pending)
Include/pymem.h110(pending)
Include/pyport.h710(pending)
Include/pystate.h132(pending)
Include/pystats.h28(pending)
Include/pystrcmp.h23(pending)
Include/pystrtod.h37(pending)
Include/Python.h155(pending)
Include/pythonrun.h42(pending)
Include/pythread.h131(pending)
Include/pytypedefs.h30(pending)
Include/rangeobject.h27(pending)
Include/refcount.h555(pending)
Include/setobject.h49(pending)
Include/sliceobject.h69(pending)
Include/structmember.h56(pending)
Include/structseq.h46(pending)
Include/sysmodule.h27(pending)
Include/traceback.h26(pending)
Include/tupleobject.h46(pending)
Include/typeslots.h96(pending)
Include/unicodeobject.h1029annotated
Include/warnings.h45(pending)
Include/weakrefobject.h46(pending)

Internal headers (Include/internal/)

FileLinesPage
Include/internal/pycore_abstract.h61(pending)
Include/internal/pycore_asdl.h112(pending)
Include/internal/pycore_ast_state.h271(pending)
Include/internal/pycore_ast.h945(pending)
Include/internal/pycore_atexit.h31(pending)
Include/internal/pycore_audit.h35(pending)
Include/internal/pycore_backoff.h133(pending)
Include/internal/pycore_bitutils.h186(pending)
Include/internal/pycore_blocks_output_buffer.h321(pending)
Include/internal/pycore_brc.h73(pending)
Include/internal/pycore_bytes_methods.h82(pending)
Include/internal/pycore_bytesobject.h149(pending)
Include/internal/pycore_c_array.h39(pending)
Include/internal/pycore_call.h214(pending)
Include/internal/pycore_capsule.h17(pending)
Include/internal/pycore_cell.h75(pending)
Include/internal/pycore_ceval_state.h48(pending)
Include/internal/pycore_ceval.h394(pending)
Include/internal/pycore_code.h671(pending)
Include/internal/pycore_codecs.h76(pending)
Include/internal/pycore_compile.h230(pending)
Include/internal/pycore_complexobject.h34(pending)
Include/internal/pycore_condvar.h93(pending)
Include/internal/pycore_context.h59(pending)
Include/internal/pycore_critical_section.h237(pending)
Include/internal/pycore_crossinterp_data_registry.h41(pending)
Include/internal/pycore_crossinterp.h406(pending)
Include/internal/pycore_debug_offsets.h379(pending)
Include/internal/pycore_descrobject.h28(pending)
Include/internal/pycore_dict_state.h28(pending)
Include/internal/pycore_dict.h412(pending)
Include/internal/pycore_dtoa.h40(pending)
Include/internal/pycore_emscripten_signal.h30(pending)
Include/internal/pycore_emscripten_trampoline.h67(pending)
Include/internal/pycore_exceptions.h40(pending)
Include/internal/pycore_faulthandler.h100(pending)
Include/internal/pycore_fileutils_windows.h98(pending)
Include/internal/pycore_fileutils.h320(pending)
Include/internal/pycore_floatobject.h49(pending)
Include/internal/pycore_flowgraph.h47(pending)
Include/internal/pycore_format.h27(pending)
Include/internal/pycore_frame.h61(pending)
Include/internal/pycore_freelist_state.h70(pending)
Include/internal/pycore_freelist.h111(pending)
Include/internal/pycore_function.h64(pending)
Include/internal/pycore_gc.h349(pending)
Include/internal/pycore_genobject.h43(pending)
Include/internal/pycore_getopt.h22(pending)
Include/internal/pycore_gil.h66(pending)
Include/internal/pycore_global_objects_fini_generated.h1592(pending)
Include/internal/pycore_global_objects.h34(pending)
Include/internal/pycore_global_strings.h854(pending)
Include/internal/pycore_hamt.h113(pending)
Include/internal/pycore_hashtable.h150(pending)
Include/internal/pycore_import.h141(pending)
Include/internal/pycore_importdl.h139(pending)
Include/internal/pycore_index_pool.h36(pending)
Include/internal/pycore_initconfig.h197(pending)
Include/internal/pycore_instruction_sequence.h83(pending)
Include/internal/pycore_instruments.h126(pending)
Include/internal/pycore_interp_structs.h994(pending)
Include/internal/pycore_interp.h109(pending)
Include/internal/pycore_interpframe_structs.h95(pending)
Include/internal/pycore_interpframe.h406(pending)
Include/internal/pycore_interpolation.h26(pending)
Include/internal/pycore_intrinsics.h51(pending)
Include/internal/pycore_jit.h29(pending)
Include/internal/pycore_list.h81(pending)
Include/internal/pycore_llist.h106(pending)
Include/internal/pycore_lock.h236(pending)
Include/internal/pycore_long.h336(pending)
Include/internal/pycore_magic_number.h305(pending)
Include/internal/pycore_memoryobject.h20(pending)
Include/internal/pycore_mimalloc.h69(pending)
Include/internal/pycore_modsupport.h99(pending)
Include/internal/pycore_moduleobject.h62(pending)
Include/internal/pycore_namespace.h21(pending)
Include/internal/pycore_object_alloc.h71(pending)
Include/internal/pycore_object_deferred.h32(pending)
Include/internal/pycore_object_stack.h95(pending)
Include/internal/pycore_object_state.h49(pending)
Include/internal/pycore_object.h1032(pending)
Include/internal/pycore_obmalloc_init.h66(pending)
Include/internal/pycore_obmalloc.h702(pending)
Include/internal/pycore_opcode_metadata.h2117(pending)
Include/internal/pycore_opcode_utils.h90(pending)
Include/internal/pycore_optimizer.h318(pending)
Include/internal/pycore_parking_lot.h97(pending)
Include/internal/pycore_parser.h78(pending)
Include/internal/pycore_pathconfig.h26(pending)
Include/internal/pycore_pyarena.h68(pending)
Include/internal/pycore_pyatomic_ft_wrappers.h202(pending)
Include/internal/pycore_pybuffer.h21(pending)
Include/internal/pycore_pyerrors.h213(pending)
Include/internal/pycore_pyhash.h91(pending)
Include/internal/pycore_pylifecycle.h136(pending)
Include/internal/pycore_pymath.h205(pending)
Include/internal/pycore_pymem_init.h103(pending)
Include/internal/pycore_pymem.h145(pending)
Include/internal/pycore_pystate.h339(pending)
Include/internal/pycore_pystats.h21(pending)
Include/internal/pycore_pythonrun.h68(pending)
Include/internal/pycore_pythread.h172(pending)
Include/internal/pycore_qsbr.h173(pending)
Include/internal/pycore_range.h21(pending)
Include/internal/pycore_runtime_init_generated.h1589(pending)
Include/internal/pycore_runtime_init.h233(pending)
Include/internal/pycore_runtime_structs.h320(pending)
Include/internal/pycore_runtime.h63(pending)
Include/internal/pycore_semaphore.h67(pending)
Include/internal/pycore_setobject.h41(pending)
Include/internal/pycore_signal.h108(pending)
Include/internal/pycore_sliceobject.h20(pending)
Include/internal/pycore_stackref.h838(pending)
Include/internal/pycore_stats.h97(pending)
Include/internal/pycore_strhex.h39(pending)
Include/internal/pycore_structs.h88(pending)
Include/internal/pycore_structseq.h40(pending)
Include/internal/pycore_symtable.h201(pending)
Include/internal/pycore_sysmodule.h32(pending)
Include/internal/pycore_template.h26(pending)
Include/internal/pycore_time.h334(pending)
Include/internal/pycore_token.h110(pending)
Include/internal/pycore_traceback.h111(pending)
Include/internal/pycore_tracemalloc.h167(pending)
Include/internal/pycore_tstate.h93(pending)
Include/internal/pycore_tuple.h75(pending)
Include/internal/pycore_typedefs.h18(pending)
Include/internal/pycore_typeobject.h160(pending)
Include/internal/pycore_typevarobject.h28(pending)
Include/internal/pycore_ucnhash.h36(pending)
Include/internal/pycore_unicodeobject_generated.h3132(pending)
Include/internal/pycore_unicodeobject.h308(pending)
Include/internal/pycore_unionobject.h26(pending)
Include/internal/pycore_uniqueid.h57(pending)
Include/internal/pycore_uop_ids.h335(pending)
Include/internal/pycore_uop_metadata.h1204(pending)
Include/internal/pycore_warnings.h21(pending)
Include/internal/pycore_weakref.h133(pending)

Internal headers carry the layout structs the public API hides: pycore_frame.h for _PyInterpreterFrame, pycore_code.h for code-object internals, pycore_dict.h for the watcher and split-dict bits, pycore_interp.h for PyInterpreterState, pycore_runtime.h for _PyRuntimeState, pycore_opcode_metadata.h / pycore_uop_metadata.h for the tier-1 and tier-2 opcode tables.