summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-39542: Convert PyType_Check() to static inline function (GH-18364)Victor Stinner2020-02-051-6/+6
| | | | Convert PyType_HasFeature(), PyType_Check() and PyType_CheckExact() macros to static inline functions.
* bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)Victor Stinner2020-02-032-42/+4
| | | | | | | | | | | Remove: * COUNT_ALLOCS macro * sys.getcounts() function * SHOW_ALLOC_COUNT code in listobject.c * SHOW_TRACK_COUNT code in tupleobject.c * PyConfig.show_alloc_count field * -X showalloccount command line option * @test.support.requires_type_collecting decorator
* bpo-39511: PyThreadState_Clear() calls on_delete (GH-18296)Victor Stinner2020-02-011-0/+4
| | | | | | | | | | | | | | | | | | PyThreadState.on_delete is a callback used to notify Python when a thread completes. _thread._set_sentinel() function creates a lock which is released when the thread completes. It sets on_delete callback to the internal release_sentinel() function. This lock is known as Threading._tstate_lock in the threading module. The release_sentinel() function uses the Python C API. The problem is that on_delete is called late in the Python finalization, when the C API is no longer fully working. The PyThreadState_Clear() function now calls the PyThreadState.on_delete callback. Previously, that happened in PyThreadState_Delete(). The release_sentinel() function is now called when the C API is still fully working.
* bpo-38631: Replace Py_FatalError() with assert() in ceval.c (GH-18279)Victor Stinner2020-01-301-1/+1
| | | | | | | Replace a few Py_FatalError() calls if tstate is NULL with assert(tstate != NULL) in ceval.c. PyEval_AcquireThread(), PyEval_ReleaseThread() and PyEval_RestoreThread() must never be called with a NULL tstate.
* bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)Joannah Nanjekye2020-01-293-6/+9
| | | | | | | | | | | | Some of the *SetItem methods in the C API steal a reference to the given value. This annotates the better behaved ones to assure the reader that these are not the ones with the inconsistent behaviour. * 📜🤖 Added by blurb_it. * make docs consistent with signature Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39429: Add a new "Python Development Mode" doc page (GH-18132)Victor Stinner2020-01-241-1/+1
|
* PyLong_AsLongLong() docs should say 'long long' (#18082)Keith Erskine2020-01-211-1/+1
|
* bpo-39161: Document multi-phase init modules under Py_NewInterpreter() ↵Petr Viktorin2020-01-091-17/+35
| | | | | | | | | (GH-17896) \+ this also adds a stronger warning against sharing objects between (sub-)interpreters. https://bugs.python.org/issue39161
* bpo-39136: Fixed typos (GH-17720)Gurupad Hegde2019-12-283-3/+3
| | | | | funtion -> function; configuraton -> configuration; defintitions -> definitions; focusses -> focuses; necesarily -> necessarily; follwing -> following; Excape -> Escape,
* Fix the miscellaneous typo (GH-17700)cocoatomo2019-12-251-1/+1
| | | A character "i" is omitted.
* Minor C API documentation improvements. (GH-17696)William Ayd2019-12-251-1/+1
| | | | | | | The added parentheses around the PyIter_Next assignment suppress the following warning which gcc throws without: ``` warning: using the result of an assignment as a condition without parentheses [-Wparentheses] ``` The other change is a typo fix
* bpo-27961: Replace PY_ULLONG_MAX with ULLONG_MAX (GH-17539)Sergey Fedoseev2019-12-091-1/+1
|
* bpo-39008: Require Py_ssize_t for PySys_Audit formats rather than raise a ↵Steve Dower2019-12-091-0/+8
| | | | deprecation warning (GH-17540)
* bpo-27961: Replace PY_LLONG_MAX, PY_LLONG_MIN and PY_ULLONG_MAX with ↵Sergey Fedoseev2019-12-051-2/+2
| | | | | standard macros (GH-15385) Use standard constants LLONG_MIN, LLONG_MAX and ULLONG_MAX.
* bpo-38892: Improve docs for audit event (GH-17361)Terry Jan Reedy2019-11-261-11/+12
|
* bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)Victor Stinner2019-11-231-5/+0
| | | | Remove PyUnicode_ClearFreeList() function: the Unicode free list has been removed in Python 3.3.
* Fix quoted signature of setattrofunc (GH-17251)Alex2019-11-221-1/+1
| | | setattrofunc returns `int`, not `PyObject *`.
* Fixed an incorrect sentence in the docs (GH-17205)Aveheuzed2019-11-211-2/+1
| | | | | | | | Fixed an incorrect sentence in Doc/c-api/mapping.rst I fell on while translating the file. skip issue Automerge-Triggered-By: @csabella
* bpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005)Serhiy Storchaka2019-11-161-1/+4
| | | | Make it a constant and referring to a constant string.
* bpo-38816: Add notes in the C-API docs about fork in subinterpreters. (GH-17176)Eric Snow2019-11-152-1/+40
| | | | | | The C-API docs are a bit sparse on the interplay between C `fork()` and the CPython runtime. This change adds some more information on the subject. https://bugs.python.org/issue38816
* bpo-36974: expand call protocol documentation (GH-13844)Jeroen Demeyer2019-11-127-288/+462
| | | | | | | | | | | | | | CC @encukou I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section. https://bugs.python.org/issue36974 Automerge-Triggered-By: @encukou Automerge-Triggered-By: @encukou
* bpo-38733: PyErr_Occurred() caller must hold the GIL (GH-17080)Victor Stinner2019-11-071-0/+2
| | | | | | | | | | | bpo-3605, bpo-38733: Optimize _PyErr_Occurred(): remove "tstate == NULL" test. Py_FatalError() no longer calls PyErr_Occurred() if called without holding the GIL. So PyErr_Occurred() no longer has to support tstate==NULL case. _Py_CheckFunctionResult(): use directly _PyErr_Occurred() to avoid explicit "!= NULL" test.
* bpo-37645: add new function _PyObject_FunctionStr() (GH-14890)Jeroen Demeyer2019-11-051-0/+1
| | | | | | | | | | | | Additional note: the `method_check_args` function in `Objects/descrobject.c` is written in such a way that it applies to all kinds of descriptors. In particular, a future re-implementation of `wrapper_descriptor` could use that code. CC @vstinner @encukou https://bugs.python.org/issue37645 Automerge-Triggered-By: @encukou
* bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)Victor Stinner2019-11-041-3/+9
| | | | | | | | | | Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as regular functions for the limited API. Previously, there were defined as macros, but these macros didn't work with the limited API which cannot access PyThreadState.recursion_depth field. Remove _Py_CheckRecursionLimit from the stable ABI. Add Include/cpython/ceval.h header file.
* bpo-38159: Clarify documentation of PyState_AddModule (GH-16101)Petr Viktorin2019-11-011-0/+11
| | | | | This was never intented to be called manually from PyInit_*. Also, clarify PyState_RemoveModule return value.
* bpo-38600: NULL -> ``NULL``. (GH-17001)Serhiy Storchaka2019-10-3019-55/+55
| | | Also fix some other formatting.
* bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-3046-664/+664
| | | | Replace all *NULL* with ``NULL``.
* bpo-38434: Fixes some audit event documentation (GH-16932)Steve Dower2019-10-262-3/+10
|
* bpo-38557: Improve documentation for list and tuple C API. (GH-16925)Serhiy Storchaka2019-10-262-12/+18
|
* bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal ↵Joannah Nanjekye2019-10-041-0/+8
| | | | | (GH-16558) Revert the removal of PyThreadState_DeleteCurrent() with documentation.
* bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)Victor Stinner2019-10-011-25/+10
| | | | PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no longer return PyStatus: they cannot fail anymore.
* bpo-38304: Remove PyConfig.struct_size (GH-16500) (GH-16508)Victor Stinner2019-10-011-36/+3
| | | | | | | For now, we'll rely on the fact that the config structures aren't covered by the stable ABI. We may revisit this in the future if we further explore the idea of offering a stable embedding API. (cherry picked from commit bdace21b769998396d0ccc8da99a8ca9b507bfdf)
* bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)Victor Stinner2019-09-291-1/+7
| | | | | | | | | Fix warnings options priority: PyConfig.warnoptions has the highest priority, as stated in the PEP 587. * Document options order in PyConfig.warnoptions documentation. * Make PyWideStringList_INIT macro private: replace "Py" prefix with "_Py". * test_embed: add test_init_warnoptions().
* bpo-38304: Add PyConfig.struct_size (GH-16451)Victor Stinner2019-09-281-5/+39
| | | | | | | | | | | | | | | | | Add a new struct_size field to PyPreConfig and PyConfig structures to allow to modify these structures in the future without breaking the backward compatibility. * Replace private _config_version field with public struct_size field in PyPreConfig and PyConfig. * Public PyPreConfig_InitIsolatedConfig() and PyPreConfig_InitPythonConfig() return type becomes PyStatus, instead of void. * Internal _PyConfig_InitCompatConfig(), _PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(), _PyPreConfig_InitFromPreConfig() return type becomes PyStatus, instead of void. * Remove _Py_CONFIG_VERSION * Update the Initialization Configuration documentation.
* bpo-38206: Clarify tp_dealloc requirements for heap allocated types. (GH-16248)Ammar Askar2019-09-272-5/+22
| | | | | | | | | | | | | | As mentioned in the bpo ticket, this mistake came up on two reviews: - https://github.com/python/cpython/pull/16127#pullrequestreview-288312751 - https://github.com/python/cpython/pull/16071#pullrequestreview-287819525 Would be nice to have it documented in a more permanent place than 3.8's whatsnew entry. https://bugs.python.org/issue38206 Automerge-Triggered-By: @encukou
* bpo-38234: Complete init config documentation (GH-16404)Victor Stinner2019-09-261-23/+37
|
* bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)Victor Stinner2019-09-261-5/+14
| | | | | | | | | | | | * Add test_embed.test_init_setpath_config(): test Py_SetPath() with PyConfig. * test_init_setpath() and test_init_setpythonhome() no longer call Py_SetProgramName(), but use the default program name. * _PyPathConfig: isolated, site_import and base_executable fields are now only available on Windows. * If executable is set explicitly in the configuration, ignore calculated base_executable: _PyConfig_InitPathConfig() copies executable to base_executable. * Complete path config documentation.
* bpo-38140: Document offsets in PyMemberDef (GH-16354)Petr Viktorin2019-09-252-1/+17
| | | | | | bpo-38140: Document offsets in PyMemberDef Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
* bpo-38234: Py_SetPath() uses the program full path (GH-16357)Victor Stinner2019-09-241-2/+6
| | | | | | | Py_SetPath() now sets sys.executable to the program full path (Py_GetProgramFullPath()), rather than to the program name (Py_GetProgramName()). Fix also memory leaks in pathconfig_set_from_config().
* bpo-38236: Dump path config at first import error (GH-16300)Victor Stinner2019-09-231-1/+11
| | | | Python now dumps path configuration if it fails to import the Python codecs of the filesystem and stdio encodings.
* bpo-38140: Make dict and weakref offsets opaque for C heap types (#16076)Eddie Elizondo2019-09-191-2/+1
| | | | | | * Make dict and weakref offsets opaque for C heap types * Add news
* bpo38158: Removing nonexistant member "doc" from PyType_Spec documentation ↵t k2019-09-151-4/+0
| | | | (GH-16142)
* bpo-29986: Doc: Delete tip to raise TypeError from tp_richcompare. (GH-16095)Julien Palard2019-09-131-6/+0
|
* Emphasize the need to always call PySequence_Fast. (GH-11140)Matti Picus2019-09-121-7/+14
|
* bpo-37363: Document internal audit events (GH-14663)Christian Heimes2019-09-121-1/+6
| | | | | | | | | Three internal cpython events were not documented, yet. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37363
* bpo-26868: Fix example usage of PyModule_AddObject. (#15725)Brandt Bucher2019-09-121-1/+16
| | | | | | | | | | | | | | | | * Add a note to the PyModule_AddObject docs. * Correct example usages of PyModule_AddObject. * Whitespace. * Clean up wording. * 📜🤖 Added by blurb_it. * First code review. * Add < 0 in the tests with PyModule_AddObject
* bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992)Hai Shi2019-09-111-2/+2
| | | https://bugs.python.org/issue37698
* bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988)Hai Shi2019-09-111-0/+7
| | | | | | | https://bugs.python.org/issue37750 Automerge-Triggered-By: @matrixise
* bpo-38103: fix conflicting labels in the docs. (GH-15906)Ezio Melotti2019-09-111-2/+2
|
* Docs: Small tweaks to c-api/intro#Include_Files (GH-14698)Kyle Stanley2019-09-101-7/+9
|