summaryrefslogtreecommitdiffstats
path: root/Doc/data
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] Document that `PyInterpreterState_GetDict` returns a borrowed ↵Miss Islington (bot)2025-10-011-0/+3
| | | | | | | | reference (GH-139451) (#139464) Document that `PyInterpreterState_GetDict` returns a borrowed reference (GH-139451) (cherry picked from commit 80cdf3ef74f6622899c1c82af1e08492e4ab7a00) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] GH-133136: Revise QSBR to reduce excess memory held (gh-135473) ↵Neil Schemenauer2025-07-301-8080/+8145
| | | | | | | | | | | | | | | | | | | | | | | | | | (gh-136480) The free threading build uses QSBR to delay the freeing of dictionary keys and list arrays when the objects are accessed by multiple threads in order to allow concurrent reads to proceed with holding the object lock. The requests are processed in batches to reduce execution overhead, but for large memory blocks this can lead to excess memory usage. Take into account the size of the memory block when deciding when to process QSBR requests. Also track the amount of memory being held by QSBR for mimalloc pages. Advance the write sequence if this memory exceeds a limit. Advancing the sequence will allow it to be freed more quickly. Process the held QSBR items from the "eval breaker", rather than from `_PyMem_FreeDelayed()`. This gives a higher chance that the global read sequence has advanced enough so that items can be freed. (cherry picked from commit 113de8545ffe74a4a1dddb9351fa1cbd3562b621) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com> Co-authored-by: Sam Gross <colesbury@gmail.com>
* [3.13] gh-135755: Docs: C API: Document missing `PyFunction_GET*` macros ↵Miss Islington (bot)2025-06-251-0/+24
| | | | | | | | | (GH-135762) (GH-135917) (cherry picked from commit ca87a47b3d92aabaefbbe79c0493d66602184b41) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Brian Schubert <brianm.schubert@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] Document that PyType_GetModuleByDef returns a borrowed reference ↵Miss Islington (bot)2025-06-191-0/+4
| | | | | | | (GH-135666) (GH-135702) (cherry picked from commit 140731ff671395fb7a869c2784429c14dc83fb27) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] gh-46236: Document PyUnicode_BuildEncodingMap (#133770)Stan Ulbrych2025-05-131-0/+3
|
* [3.13] gh-46236: Add missing PyUnicode_FromOrdinal() doc (#132040) (#132521)Victor Stinner2025-04-141-0/+3
| | | | | | | gh-46236: Add missing PyUnicode_FromOrdinal() doc (#132040) (cherry picked from commit 8768df2fe94a8444baff47a5b8c7414a2118731a) Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* [3.13] gh-46236: Add docs for PyUnicode_GetDefaultEncoding() doc (GH-130335) ↵Miss Islington (bot)2025-02-241-0/+3
| | | | | | | | | | | (GH-130511) * Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding (cherry picked from commit 9f25c1f012c8d432a93bf2dcad5f19a64dc00d3c) Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* [3.13] gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and ↵Miss Islington (bot)2025-02-201-3/+16
| | | | | | | | | PyUnicode_RPartition (GH-130191) (#130360) gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition (GH-130191) (cherry picked from commit 0f5b82169e12321fd2294bf534496ad42a682ac4) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) ↵Miss Islington (bot)2025-02-101-0/+7
| | | | | | | | | | | (GH-129961) gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) (cherry picked from commit 8d9d3e4ecb4c908df6560b54138dd5af73b3ed47) Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] Document PyObject_SelfIter (GH-127861) (#127898)Miss Islington (bot)2024-12-131-0/+3
| | | | | | Document PyObject_SelfIter (GH-127861) (cherry picked from commit 58942a07df8811afba9c58dc16c1aab244ccf27a) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* [3.13] gh-126914: Store the Preallocated Thread State's Pointer in a ↵Eric Snow2024-12-021-29396/+29418
| | | | | | | PyInterpreterState Field (gh-127114) This approach eliminates the originally reported race. It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then. This is mostly a cherry-pick of 1c0a104 (AKA gh-126989). The difference is we add PyInterpreterState.threads_preallocated at the end of PyInterpreterState, instead of adding PyInterpreterState.threads.preallocated. That avoids ABI disruption.
* [3.13] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) ↵Miss Islington (bot)2024-12-021-19/+21
| | | | | | | | | | (#127496) gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) Fix incorrect entries in `Doc/data/refcounts.dat` (cherry picked from commit 1f8267b85dda655282922ba20df90d0ac6bea634) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.13] gh-125268: Use static string for "1e309" in AST (GH-125272) (GH-125280)Sam Gross2024-10-241-4765/+4776
| | | | | | When formatting the AST as a string, infinite values are replaced by 1e309, which evaluates to infinity. The initialization of this string replacement was not thread-safe in the free threading build. (cherry picked from commit 427dcf24de4e06d239745d74d08c4b2e541dca5a)
* [3.13] GH-124567: Revert the Incremental GC in 3.13 (#124770)T. Wouters2024-09-301-4906/+4904
| | | | | Revert the incremental GC in 3.13, since it's not clear that without further turning, the benefits outweigh the costs. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.13] Add debug offsets for free threaded builds (GH-123041) (#123055)Miss Islington (bot)2024-08-181-16877/+16694
| | | | | | | | | | | | * Add debug offsets for free threaded builds (GH-123041) (cherry picked from commit d7a3df91505faa56c51d169648253bd0d57ddae2) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> * Refresh ABI file --------- Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.13] Add the Python 3.13 abidump, and enable the ABI check. (#122583)T. Wouters2024-08-021-0/+29570
| | | | | dd the Python 3.13 abidump, and enable the ABI check. Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* [3.13] GH-121970: Rewrite the C-API annotations extension (#121985) (#122027)Adam Turner2024-07-191-849/+849
| | | | | | GH-121970: Rewrite the C-API annotations extension (#121985) Co-authored-by: Petr Viktorin <encukou@gmail.com> (cherry picked from commit 22c9d9c1fcc3bb6186524330b169eda6df450f1b)
* [3.13] gh-119521: Rename IncompleteInputError to _IncompleteInputError and ↵Miss Islington (bot)2024-06-241-1/+0
| | | | | | | | | | | | | remove from public API/ABI (GH-119680, GH-120955) (GH-120944) - gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680) (cherry picked from commit ce1064e4c9bcfd673323ad690e60f86e1ab907bb) - gh-119521: Use `PyAPI_DATA`, not `extern`, for `_PyExc_IncompleteInputError` (GH-120955) (cherry picked from commit ac61d58db0753a3b37de21dbc6e86b38f2a93f1b) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] gh-74929: PEP 667 C API documentation (gh-119892)Miss Islington (bot)2024-06-011-0/+32
| | | | | | | | | | | * Add docs for new APIs * Add soft-deprecation notices * Add What's New porting entries * Update comments referencing `PyFrame_LocalsToFast()` to mention the proxy instead * Other related cleanups found when looking for refs to the deprecated APIs (cherry picked from commit 3859e09e3d92d004978dd838f0511364e7edfb94) Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* gh-74929: Implement PEP 667 (GH-115153)Tian Gao2024-05-041-0/+3
|
* gh-117987: Restore several functions removed in Python 3.13 alpha 1 (GH-117993)Victor Stinner2024-04-181-0/+4
| | | | | | | | | Restore these functions removed in Python 3.13 alpha 1: * Py_SetPythonHome() * Py_SetProgramName() * PySys_SetArgvEx() * PySys_SetArgv()
* gh-117929: Restore removed PyEval_InitThreads() function (#117931)Victor Stinner2024-04-171-0/+1
|
* gh-116936: Add PyType_GetModuleByDef() to the limited C API (#116937)Victor Stinner2024-03-251-0/+1
|
* gh-115754: Add Py_GetConstant() function (#116883)Victor Stinner2024-03-211-0/+2
| | | | | | | | | | | | Add Py_GetConstant() and Py_GetConstantBorrowed() functions. In the limited C API version 3.13, getting Py_None, Py_False, Py_True, Py_Ellipsis and Py_NotImplemented singletons is now implemented as function calls at the stable ABI level to hide implementation details. Getting these constants still return borrowed references. Add _testlimitedcapi/object.c and test_capi/test_object.py to test Py_GetConstant() and Py_GetConstantBorrowed() functions.
* gh-111696, PEP 737: Add PyType_GetModuleName() function (#116824)Victor Stinner2024-03-141-0/+1
| | | Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-111696, PEP 737: Add PyType_GetFullyQualifiedName() function (#116815)Victor Stinner2024-03-141-0/+1
| | | Rewrite tests on type names in Python, they were written in C.
* gh-114626: add PyCFunctionFast and PyCFunctionFastWithKeywords (GH-114627)David Hewitt2024-02-151-0/+2
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-114329: Add `PyList_GetItemRef` function (GH-114504)Sam Gross2024-02-022-0/+5
| | | | | | | The new `PyList_GetItemRef` is similar to `PyList_GetItem`, but returns a strong reference instead of a borrowed reference. Additionally, if the passed "list" object is not a list, the function sets a `TypeError` instead of calling `PyErr_BadInternalCall()`.
* gh-113744: Add a new IncompleteInputError exception to improve incomplete ↵Pablo Galindo Salgado2024-01-301-0/+1
| | | | | input detection in the codeop module (#113745) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-102468: Document `PyCFunction_New*` and `PyCMethod_New` (GH-112557)AN Long2024-01-161-0/+15
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-113696: Docs: Annotate PyObject_CallOneArg and PyObject_CallNoArgs as ↵Jamie Phan2024-01-041-0/+7
| | | | returning a strong reference (#113697)
* gh-111089: Revert PyUnicode_AsUTF8() changes (#111833)Victor Stinner2023-11-071-1/+0
| | | | | | | | | | | | | | | | | | | | | * Revert "gh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (#111585)" This reverts commit d9b606b3d04fc56fb0bcc479d7d6c14562edb5e2. * Revert "gh-111089: Use PyUnicode_AsUTF8() in getargs.c (#111620)" This reverts commit cde1071b2a72e8261ca66053ef61431b7f3a81fd. * Revert "gh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)" This reverts commit d731579bfb9a497cfb0076cb6b221058a20088fe. * Revert "gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)" This reverts commit d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44. * Revert "gh-111089: Use PyUnicode_AsUTF8() in sqlite3 (#111122)" This reverts commit 37e4e20eaa8f27ada926d49e5971fecf0477ad26.
* gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)Victor Stinner2023-10-201-0/+1
| | | | | | | | Add PyUnicode_AsUTF8() function to the limited C API. multiprocessing posixshmem now uses PyUnicode_AsUTF8() instead of PyUnicode_AsUTF8AndSize(): the extension is built with the limited C API. The function now raises an exception if the filename contains an embedded null character instead of truncating silently the filename.
* gh-85283: Add PySys_Audit() to the limited C API (#108571)Victor Stinner2023-10-171-0/+2
| | | | | | | | | | The PySys_Audit() function was added in Python 3.8 by the PEP 578 "Python Runtime Audit Hooks". Add also PySys_AuditTuple() to the limited C API, function added to Python 3.13. Move non-limited "PerfMap" C API from Include/sysmodule.h to Include/cpython/sysmodule.h.
* gh-85283: Add PyMem_RawMalloc() to the limited C API (#108570)Victor Stinner2023-10-171-0/+4
| | | | | | | | | Add PyMem_RawMalloc(), PyMem_RawCalloc(), PyMem_RawRealloc() and PyMem_RawFree() to the limited C API. These functions were added by Python 3.4 and are needed to port stdlib extensions to the limited C API, like grp and pwd. Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-110289: C API: Add PyUnicode_EqualToUTF8() and ↵Serhiy Storchaka2023-10-111-0/+2
| | | | PyUnicode_EqualToUTF8AndSize() functions (GH-110297)
* gh-110397: Add Py_IsFinalizing() to the stable ABI (#110441)Victor Stinner2023-10-071-0/+1
|
* gh-110014: Remove PY_TIMEOUT_MAX from limited C API (#110217)Victor Stinner2023-10-021-1/+0
| | | | | | | | If the timeout is greater than PY_TIMEOUT_MAX, PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX microseconds, which is around 280.6 years. This case is unlikely and limiting a timeout to 280.6 years sounds like a reasonable trade-off. The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.
* gh-110014: Fix _POSIX_THREADS and _POSIX_SEMAPHORES usage (#110139)Victor Stinner2023-09-301-0/+1
| | | | | | | | | | | | | | | | * pycore_pythread.h is now the central place to make sure that _POSIX_THREADS and _POSIX_SEMAPHORES macros are defined if available. * Make sure that pycore_pythread.h is included when _POSIX_THREADS and _POSIX_SEMAPHORES macros are tested. * PY_TIMEOUT_MAX is now defined as a constant, since its value depends on _POSIX_THREADS, instead of being defined as a macro. * Prevent integer overflow in the preprocessor when computing PY_TIMEOUT_MAX_VALUE on Windows: replace "0xFFFFFFFELL * 1000 < LLONG_MAX" with "0xFFFFFFFELL < LLONG_MAX / 1000". * Document the change and give hints how to fix affected code. * Add an exception for PY_TIMEOUT_MAX name to smelly.py * Add PY_TIMEOUT_MAX to the stable ABI
* gh-108511: Add C API functions which do not silently ignore errors (GH-109025)Serhiy Storchaka2023-09-171-0/+4
| | | | | | | | | Add the following functions: * PyObject_HasAttrWithError() * PyObject_HasAttrStringWithError() * PyMapping_HasKeyWithError() * PyMapping_HasKeyStringWithError()
* gh-108444: Add PyLong_AsInt() public function (#108445)Victor Stinner2023-08-241-0/+1
| | | | | | * Rename _PyLong_AsInt() to PyLong_AsInt(). * Add documentation. * Add test. * For now, keep _PyLong_AsInt() as an alias to PyLong_AsInt().
* gh-106004: Add PyDict_GetItemRef() function (#106005)Victor Stinner2023-07-211-0/+2
| | | | | * Add PyDict_GetItemRef() and PyDict_GetItemStringRef() functions. Add these functions to the stable ABI version 3.13. * Add unit tests on the PyDict C API in test_capi.
* bpo-42327: C API: Add PyModule_Add() function (GH-23443)Serhiy Storchaka2023-07-181-0/+1
| | | | | It is a fixed implementation of PyModule_AddObject() which consistently steals reference both on success and on failure.
* gh-106307: C API: Add PyMapping_GetOptionalItem() function (GH-106308)Serhiy Storchaka2023-07-111-0/+2
| | | | Also add PyMapping_GetOptionalItemString() function.
* gh-106521: Add PyObject_GetOptionalAttr() function (GH-106522)Serhiy Storchaka2023-07-111-0/+2
| | | | | | It is a new name of former _PyObject_LookupAttr(). Add also PyObject_GetOptionalAttrString().
* gh-106572: Convert PyObject_DelAttr() to a function (#106611)Victor Stinner2023-07-111-0/+2
| | | | | | | | * Convert PyObject_DelAttr() and PyObject_DelAttrString() macros to functions. * Add PyObject_DelAttr() and PyObject_DelAttrString() functions to the stable ABI. * Replace PyObject_SetAttr(obj, name, NULL) with PyObject_DelAttr(obj, name).
* gh-105927: Add PyWeakref_GetRef() function (#105932)Victor Stinner2023-06-212-0/+5
| | | | Add tests on PyWeakref_NewRef(), PyWeakref_GetObject(), PyWeakref_GET_OBJECT() and PyWeakref_GetRef().
* Add Py_TYPE() to Doc/data/refcounts.dat (#105949)Victor Stinner2023-06-201-0/+3
|
* gh-105922: Add PyImport_AddModuleRef() function (#105923)Victor Stinner2023-06-202-0/+4
| | | | | | * Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and PyImport_AddModuleObject(). * pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with PyImport_AddModuleRef(name).
* gh-85275: Remove old buffer APIs (#105137)Inada Naoki2023-06-022-19/+0
| | | | | They are now abi-only. Co-authored-by: Victor Stinner <vstinner@python.org>