summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code ↵Miss Islington (bot)2024-11-231-1/+5
| | | | | | | | (GH-126667) (#127202) Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.12] gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` ↵Miss Islington (bot)2024-10-031-1/+1
| | | | | | | | (gh-124920) (gh-124931) gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920) (cherry picked from commit 9eeb21bf761070649bf8d78976a62dabb6d67a99) Co-authored-by: Donghee Na <donghee.na@python.org>
* [3.12] gh-120838: Add a Note in the Docs About Expectations for ↵Miss Islington (bot)2024-06-211-3/+10
| | | | | | | Py_Finalize() (gh-120853) (cherry picked from commit 03fa2df92707b543c304a426732214002f81d671, AKA gh-120839) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] Docs: add link roles with Sphinx extlinks (GH-117850) (#117910)Hugo van Kemenade2024-04-151-1/+1
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-115664: Fix ordering of more versionadded and versionchanged ↵Serhiy Storchaka2024-03-071-2/+2
| | | | | directives (GH-116298) (GH-116450) (cherry picked from commit 808a77612fb89b125d25efac2788522a100e8a6d)
* [3.12] gh-115172: Fix explicit index extries for the C API (GH-115173) ↵Serhiy Storchaka2024-02-111-16/+13
| | | | | (GH-115292) (cherry picked from commit 573acb30f22a84c0f2c951efa002c9946e29b6a3)
* [3.12] gh-101100: Properly document frame object attributes (GH-112735) ↵Miss Islington (bot)2023-12-051-2/+3
| | | | | | | | (#112772) gh-101100: Properly document frame object attributes (GH-112735) (cherry picked from commit d109f637c048c2b5fc95dc7fdfd50f8ac41a7747) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters ↵Miss Islington (bot)2023-07-311-0/+1
| | | | | | | | | | (GH-107403) (gh-107521) gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403) It was added in 3.12 for PEP 684 (per-interpreter GIL). (cherry picked from commit fb344e99aa0da5bef9318684ade69978585fe060) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-107305: Update the C-API Docs for PEP 684 (gh-107324) (gh-107402)Miss Islington (bot)2023-07-281-15/+194
| | | | | | gh-107305: Update the C-API Docs for PEP 684 (gh-107324) (cherry picked from commit c0b81c4b5438a3565fadd9d6f5bc69f989a3fdee) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-107298: Fix more Sphinx warnings in the C API doc (GH-107329) ↵Serhiy Storchaka2023-07-281-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-107376) Declare the following functions as macros, since they are actually macros. It avoids a warning on "TYPE" or "macro" argument. * PyMem_New() * PyMem_Resize() * PyModule_AddIntMacro() * PyModule_AddStringMacro() * PyObject_GC_New() * PyObject_GC_NewVar() * PyObject_New() * PyObject_NewVar() Add C standard C types to nitpick_ignore in Doc/conf.py: * int64_t * uint64_t * uintptr_t No longer ignore non existing "__int" type in nitpick_ignore. Update Doc/tools/.nitignore. (cherry picked from commit 8d61a71f9c81619e34d4a30b625922ebc83c561b) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-107091: Fix some uses of :attr: role (GH-107318) (GH-107330)Serhiy Storchaka2023-07-271-2/+5
| | | | | Fix also formatting of PyMethodDef members. (cherry picked from commit d363eb5b0255c055e7b43f5e2c0847f555e1982e)
* [3.12] gh-106919: Use role :c:macro: for referencing the C "constants" ↵Serhiy Storchaka2023-07-211-31/+31
| | | | | (GH-106920) (GH-106951) (cherry picked from commit fcc816dbff7ca66c26f57a506e4d2330fe41d0ff)
* GH-97950: Use new-style index directive ('module') (#103996)Adam Turner2023-05-041-7/+7
| | | | | | | | | | | | | | | | | * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference * Use new-style index directive ('module') - Tutorial * Uncomment module removal in pairindextypes * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference
* gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)Julien Palard2023-03-151-1/+1
| | | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Fix typo in `Py_GetPythonHome` signature (#102168)Tanner Firl2023-02-231-1/+1
|
* Fix deprecation doc for `PyEval_InitThreads` (#100667)Alexander Shadchin2023-01-021-2/+2
|
* gh-99377: Revert audit events for thread state creation and free, because ↵Steve Dower2022-11-171-13/+0
| | | | the GIL is not properly held at these times (GH-99543)
* gh-99377: Add audit events for thread creation and clear (GH-99378)Steve Dower2022-11-161-0/+13
|
* Doc: Found some remaining default roles. (GH-98392)Julien Palard2022-10-181-1/+1
|
* Docs: Fix backtick errors found by sphinx-lint (#97998)Hugo van Kemenade2022-10-071-1/+1
| | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)Adam Turner2022-10-051-14/+14
| | | | | :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-93738: Documentation C syntax (Function glob patterns -> literal markup) ↵Adam Turner2022-10-051-3/+3
| | | | (#97774)
* gh-93738: Documentation C syntax (:c:type:`PyObject` -> :c:expr:`PyObject`) ↵Adam Turner2022-10-041-1/+1
| | | | | (#97776) :c:type:`PyObject` -> :c:expr:`PyObject`
* gh-93738: Documentation C syntax (:c:type:`PyInterpreterState *` -> ↵Adam Turner2022-10-041-1/+1
| | | | | :c:expr:`PyInterpreterState *`) (#97777) :c:type:`PyInterpreterState *` -> :c:expr:`PyInterpreterState *`
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-241-0/+24
| | | | | | | | | | | | | | | | | the C-API (#93504) * gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs
* gh-93103: Deprecate global configuration variable (#93104)Victor Stinner2022-05-231-0/+109
| | | | | Deprecate global configuration variables, like Py_IgnoreEnvironmentFlag, in the documentation: the Py_InitializeFromConfig() API should be instead.
* gh-88279: Deprecate PySys_SetArgvEx() (#92363)Victor Stinner2022-05-061-0/+13
| | | | | | | Deprecate the following C functions: * PySys_SetArgv() * PySys_SetArgvEx() * PySys_SetPath()
* gh-92047: Py_GetVersion multi-digit minor version (GH-92047) (#92048)Robert Howlett2022-05-051-1/+1
|
* gh-88097: doc: fix link to Py_Version (#92141)Victor Stinner2022-05-021-1/+1
|
* GH-88756: Update docs for PEP 523 eval function type. (GH-91788)Mark Shannon2022-04-211-1/+4
|
* Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API ↵Victor Stinner2022-04-061-10/+1
| | | | | | | | | | | (GH-32052)" (GH-32343) * Revert "bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)" This reverts commit f877b40e3f7e0d97878884d80fbec879a85ab7e8. * Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" This reverts commit b9a5522dd952125a99ff554f01f311cae25f5a91.
* More minor fixes to C API docs (GH-31525)Jelle Zijlstra2022-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * wording fixes in type.rst * grammar and punctuation in sys.rst * set: grammar fixes * structures: capitalization fix * grammar fixes for sequence * objects: point to Py_TYPE instead of direct object access * numbers: add more explicit Python equivalences * method: add missing period * memory: grammar fix * mapping: grammar fixes * long: grammar fix * iter: fix grammar for PyAIter_Check * init: grammar fix
* bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API ↵Victor Stinner2022-04-011-1/+10
| | | | | | | | | | | (GH-32054) Move the private _PyFrameEvalFunction type, and private _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions to the internal C API. The _PyFrameEvalFunction callback function type now uses the _PyInterpreterFrame type which is part of the internal C API. Update the _PyFrameEvalFunction documentation.
* bpo-43931: Export Python version as API data (GH-25577)Gabriele N. Tornetta2021-12-101-0/+2
| | | | | When Python is embedded in other applications, it is not easy to determine which version of Python is being used. This change exposes the Python version as part of the API data. Tools like Austin (https://github.com/P403n1x87/austin) can benefit from this data when targeting applications like uWSGI, as the Python version can then be inferred systematically by looking at the exported symbols rather than relying on unreliable pattern matching or other hacks (like remote code execution etc...). Automerge-Triggered-By: GH:pablogsal
* [doc]: Fix missing space in c-api/init.rst and add rstlint rule (GH-28988)Julien Palard2021-10-191-2/+2
|
* bpo-43760: Add PyThreadState_EnterTracing() (GH-28542)Victor Stinner2021-10-151-0/+24
| | | | | | | | | | Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing() functions to the limited C API to suspend and resume tracing and profiling. Add an unit test on the PyThreadState C API to _testcapi. Add also internal _PyThreadState_DisableTracing() and _PyThreadState_ResetTracing().
* bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515)Serhiy Storchaka2021-09-221-3/+3
| | | | | | | Replace old names when they refer to actual versions of macOS. Keep historical names in references to older versions. Co-authored-by: Patrick Reader <_@pxeger.com>
* bpo-45019: Add a tool to generate list of modules to include for frozen ↵Eric Snow2021-08-301-1/+1
| | | | | | | modules (gh-27980) Frozen modules must be added to several files in order to work properly. Before this change this had to be done manually. Here we add a tool to generate the relevant lines in those files instead. This helps us avoid mistakes and omissions. https://bugs.python.org/issue45019
* bpo-44113: Deprecate old functions to config Python init (GH-26060)Victor Stinner2021-05-121-0/+32
| | | | | | | | | | | | | | | | | Deprecate the following functions to configure the Python initialization: * PySys_AddWarnOption() * PySys_AddWarnOptionUnicode() * PySys_AddXOption() * PySys_HasWarnOptions() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587).
* Docs: Remove stray semicolon in init.rst (GH-23974)Ken Jin2021-01-141-1/+1
| | | Removed stray semicolon which was causing the docs to render weirdly (it's the function right under the one [here](https://docs.python.org/3/c-api/init.html#c._PyInterpreterState_GetEvalFrameFunc)).
* bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)Victor Stinner2020-11-101-0/+36
| | | | | | | | | | | | | | | | | | | Fix _PyConfig_Read() if compute_path_config=0: use values set by Py_SetPath(), Py_SetPythonHome() and Py_SetProgramName(). Add compute_path_config parameter to _PyConfig_InitPathConfig(). The following functions now return NULL if called before Py_Initialize(): * Py_GetExecPrefix() * Py_GetPath() * Py_GetPrefix() * Py_GetProgramFullPath() * Py_GetProgramName() * Py_GetPythonHome() These functions no longer automatically computes the Python Path Configuration. Moreover, Py_SetPath() no longer computes program_full_path.
* bpo-42294: Add borrowed/strong reference to doc glossary (GH-23206)Victor Stinner2020-11-091-1/+1
| | | | | | Add "borrowed reference" and "strong reference" to the documentation glossary. Enhance also Py_INCREF() and Py_NewRef() documentation.
* bpo-42236: Enhance init and encoding documentation (GH-23109)Victor Stinner2020-11-021-2/+3
| | | | | | | | | | | | | | | | | | | | | Enhance the documentation of the Python startup, filesystem encoding and error handling, locale encoding. Add a new "Python UTF-8 Mode" section. * Add "locale encoding" and "filesystem encoding and error handler" to the glossary * Remove documentation from Include/cpython/initconfig.h: move it to Doc/c-api/init_config.rst. * Doc/c-api/init_config.rst: * Document command line options and environment variables * Document default values. * Add a new "Python UTF-8 Mode" section in Doc/library/os.rst. * Add warnings to Py_DecodeLocale() and Py_EncodeLocale() docs. * Document how Python selects the filesystem encoding and error handler at a single place: PyConfig.filesystem_encoding and PyConfig.filesystem_errors. * PyConfig: move orig_argv member at the right place.
* bpo-40204, doc: Fix syntax of C variables (GH-21846)Victor Stinner2020-08-131-24/+24
| | | | | | | | | | | | | | | For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3.
* bpo-40429: PyThreadState_GetFrame() returns a strong ref (GH-19781)Victor Stinner2020-04-291-3/+3
| | | | The PyThreadState_GetFrame() function now returns a strong reference to the frame.
* bpo-40421: Add PyFrame_GetCode() function (GH-19757)Victor Stinner2020-04-281-2/+4
| | | | | | | | | PyFrame_GetCode(frame): return a borrowed reference to the frame code. Replace frame->f_code with PyFrame_GetCode(frame) in most code, except in frameobject.c, genobject.c and ceval.c. Also add PyFrame_GetLineNumber() to the limited C API.
* bpo-40302: Replace PY_INT64_T with int64_t (GH-19573)Victor Stinner2020-04-171-1/+1
| | | | | | | | | * Replace PY_INT64_T with int64_t * Replace PY_UINT32_T with uint32_t * Replace PY_UINT64_T with uint64_t sha3module.c no longer checks if PY_UINT64_T is defined since it's always defined and uint64_t is always available on platforms supported by Python.
* bpo-38644: Make tstate more explicit inside pystate.c (GH-19182)Victor Stinner2020-03-261-0/+2
| | | | Fix PyInterpreterState_New(): Don't call PyErr_SetString() when there is no current Python thread state (if tstate is NULL).
* bpo-39947: Add PyThreadState_GetID() function (GH-19163)Victor Stinner2020-03-251-0/+9
| | | | Add PyThreadState_GetID() function: get the unique identifier of a Python thread state.
* bpo-39947: Add PyThreadState_GetFrame() function (GH-19092)Victor Stinner2020-03-201-0/+12
| | | | Add PyThreadState_GetFrame() function: get the current frame of a Python thread state.