summaryrefslogtreecommitdiffstats
path: root/Doc/data
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)Victor Stinner2023-06-012-10/+0
| | | | | | | | | | | | Remove functions in the C API: * PyEval_AcquireLock() * PyEval_ReleaseLock() * PyEval_InitThreads() * PyEval_ThreadsInitialized() But keep these functions in the stable ABI. Mention "make regen-limited-abi" in "make regen-all".
* gh-105107: Remove PyCFunction_Call() function (#105181)Victor Stinner2023-06-011-1/+0
| | | | | * Keep the function in the stable ABI. * Add unit tests on PyCFunction_Call() since it remains supported in the stable ABI.
* gh-105156: Cleanup usage of old Py_UNICODE type (#105158)Victor Stinner2023-06-011-40/+20
| | | | | | | | | | | | * refcounts.dat: * Remove Py_UNICODE functions. * Replace Py_UNICODE argument type with wchar_t. * _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(), _PyUnicode_ToTitlecase() are no longer deprecated in comments. It's no longer needed since they now use Py_UCS4 type, rather than the deprecated Py_UNICODE type. * gdb: Remove unused char_width() method.
* gh-105145: Remove old functions to config Python init (#105154)Victor Stinner2023-06-011-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the following old functions to configure the Python initialization, deprecated in Python 3.11: * PySys_AddWarnOptionUnicode() * PySys_AddWarnOption() * PySys_AddXOption() * PySys_HasWarnOptions() * PySys_SetArgvEx() * PySys_SetArgv() * PySys_SetPath() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Most of these functions are kept in the stable ABI, except: * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Update Doc/extending/embedding.rst and Doc/extending/extending.rst to use the new PyConfig API. _testembed.c: * check_stdio_details() now sets stdio_encoding and stdio_errors of PyConfig. * Add definitions of functions removed from the API but kept in the stable ABI. * test_init_from_config() and test_init_read_set() now use PyConfig_SetString() instead of PyConfig_SetBytesString(). Remove _Py_ClearStandardStreamEncoding() internal function.
* gh-105107: Remove PyEval_CallFunction() function (#105108)Victor Stinner2023-05-311-3/+0
| | | | | | | | | | | | | | Remove 4 functions from the C API, deprecated in Python 3.9: * PyEval_CallObjectWithKeywords() * PyEval_CallObject() * PyEval_CallFunction() * PyEval_CallMethod() Keep 3 functions in the stable ABI: * PyEval_CallObjectWithKeywords() * PyEval_CallFunction() * PyEval_CallMethod()
* gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)Petr Viktorin2023-05-041-0/+2
| | | | Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-102755: Add PyErr_DisplayException(exc) (#102756)Irit Katriel2023-03-161-0/+1
|
* gh-101578: Amend exception docs (#102057)Erlend E. Aasland2023-02-211-0/+2
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-101578: Amend PyErr_{Set,Get}RaisedException docs (#101962)Erlend E. Aasland2023-02-191-0/+3
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-101578: Normalize the current exception (GH-101607)Mark Shannon2023-02-081-0/+4
| | | | | | | | | | * Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
* bpo-43327: Fix the docs for PyImport_ImportFrozenModuleObject() (#24659)Zackery Spytz2022-11-271-2/+2
| | | | | | The docs stated that PyImport_ImportFrozenModuleObject() returns a new reference, but it actually returns an int. Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h ↵Petr Viktorin2022-11-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-99014) The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra include and non-namespaced macros bother you greatly). Specifically, no uses in CPython are updated -- that would just be unnecessary churn. The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. Its contents are now available just by including ``Python.h``, with a ``Py`` prefix added if it was missing: - `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne` - Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc. (previously ``T_INT``, ``T_DOUBLE``, etc.) - The flags `Py_READONLY` (previously ``READONLY``) and `Py_AUDIT_READ` (previously all uppercase) Several items are not exposed from ``Python.h``: - `T_OBJECT` (use `Py_T_OBJECT_EX`) - `T_NONE` (previously undocumented, and pretty quirky) - The macro ``WRITE_RESTRICTED`` which does nothing. - The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of `Py_AUDIT_READ`. - In some configurations, ``<stddef.h>`` is not included from ``Python.h``. It should be included manually when using ``offsetof()``. The deprecated header continues to provide its original contents under the original names. Your old code can stay unchanged, unless the extra include and non-namespaced macros bother you greatly. There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or similar. I chose not to do that -- users will probably copy/paste that with any spelling, and not renaming it makes migration docs simpler. Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com> Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
* gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)David Hewitt2022-10-311-0/+2
| | | This adds them to the Limited API.
* gh-98586: Add vector call APIs to the Limited API (GH-98587)Wenzel Jakob2022-10-271-0/+3
| | | Expose the facilities for making vector calls through Python's limited API.
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-241-0/+8
| | | | | | | | | | | | | | | | | 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-93274: Expose receiving vectorcall in the Limited API (GH-95717)Petr Viktorin2022-08-081-0/+3
|
* gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)Wenzel Jakob2022-05-271-0/+1
| | | | | | | | Added a new stable API function ``PyType_FromMetaclass``, which mirrors the behavior of ``PyType_FromModuleAndSpec`` except that it takes an additional metaclass argument. This is, e.g., useful for language binding tools that need to store additional information in the type object.
* gh-85858: Remove PyUnicode_InternImmortal() function (#92579)Victor Stinner2022-05-131-1/+0
| | | | | | | | | | | | | | | | | Remove the PyUnicode_InternImmortal() function and the SSTATE_INTERNED_IMMORTAL macro. The PyUnicode_InternImmortal() function is still exported in the stable ABI. The function is removed from the API. PyASCIIObject.state.interned size is now a single bit, rather than 2 bits. Keep SSTATE_NOT_INTERNED and SSTATE_INTERNED_MORTAL macros for backward compatibility, but no longer use them internally since the interned member is now a single bit and so can only have two values (interned or not interned). Update stats of _PyUnicode_ClearInterned().
* gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)Inada Naoki2022-05-121-1/+0
|
* gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)Irit Katriel2022-04-151-0/+2
|
* Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition ↵Petr Viktorin2022-04-081-1/+1
| | | | (GH-32365)
* bpo-47115: Document which parts of structs are in limited API/stable ABI ↵Petr Viktorin2022-04-061-881/+885
| | | | | | (GH-32196) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45459: Add Py_buffer to limited API (GH-29991)Christian Heimes2022-02-021-0/+13
| | | | | | | | | | | - [x] ``Py_buffer`` struct - [x] ``PyBuffer_*()`` API functions - [x] ``PyBUF_*`` constants - [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots - [x] ``PyMemoryView_FromBuffer()`` API - [x] tests for limited API - [x] ``make regen-limited-abi`` - [x] documentation update - [ ] export ``PyPickleBuffer*()`` API ???
* bpo-43931: Export Python version as API data (GH-25577)Gabriele N. Tornetta2021-12-101-0/+1
| | | | | 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
* bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes ↵Irit Katriel2021-10-221-0/+1
| | | | (GH-28569)
* bpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331)Ken Jin2021-10-211-0/+1
|
* bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194)Yury Selivanov2021-09-072-6/+6
| | | | | | | | Fix PyAiter_Check to only check for the `__anext__` presense (not for `__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`, `PyObject_GetAiter()` -> `PyObject_GetAIter()`. Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551)Hai Shi2021-08-172-0/+4
|
* bpo-41103: Resurrect the old buffer protocol. (GH-27437)Inada Naoki2021-07-292-0/+22
| | | | | Revert "bpo-41103: Remove old buffer protocol support (#21117)" This reverts commit 6f8a6ee59cb7f99f68df8ee9c3e8c8cf19af3eed.
* bpo-42035: Add a PyType_GetName() to get type's short name. (GH-23903)Hai Shi2021-07-292-0/+4
|
* bpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855)Petr Viktorin2021-06-241-26/+0
| | | | | | I tried to be relatively thorough and give lots of links. One reason is that this wasn't deprecated very long; also it seems people running into this tend to not be familiar with similar APIs. Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)Ken Jin2021-06-161-1/+1
| | | | Also fix stable ABI type definitions